Skip to content

Commit da173ae

Browse files
committed
Small Bugfix with Selection Drawing
1 parent b5c4f8a commit da173ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/CodeEditSourceEditor/Minimap/MinimapLineRenderer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ final class MinimapLineRenderer: TextLayoutManagerRenderDelegate {
6161
}
6262

6363
func characterXPosition(in lineFragment: LineFragment, for offset: Int) -> CGFloat {
64-
8 + (CGFloat(offset) * 1.5)
64+
// Offset is relative to the whole line, the CTLine is too.
65+
return 8 + (CGFloat(offset - CTLineGetStringRange(lineFragment.ctLine).location) * 1.5)
6566
}
6667
}

0 commit comments

Comments
 (0)