Skip to content

Commit 2b9ab46

Browse files
committed
better rounding
1 parent 898f2f4 commit 2b9ab46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/src/main/java/de/markusressel/kodeeditor/library/view/CodeEditorLayout.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ constructor(
170170
}
171171

172172
minimapContainerLayout.background = GradientDrawable().apply {
173-
setStroke(field.toInt(), minimapBorderColor)
173+
setStroke(valueAsInt, minimapBorderColor)
174174
}
175175
}
176176

@@ -183,7 +183,7 @@ constructor(
183183
field = value
184184

185185
minimapContainerLayout.background = GradientDrawable().apply {
186-
setStroke(minimapBorderWidth.toInt(), field)
186+
setStroke(minimapBorderWidth.toFloat().roundToInt(), field)
187187
}
188188
}
189189

@@ -196,7 +196,7 @@ constructor(
196196
field = value
197197

198198
minimapIndicator.background = GradientDrawable().apply {
199-
setStroke(minimapBorderWidth.toInt(), field)
199+
setStroke(minimapBorderWidth.toFloat().roundToInt(), field)
200200
}
201201
}
202202

@@ -459,7 +459,7 @@ constructor(
459459
val scaledWidth = lineNumberTextView.width * engine.realZoom
460460
val maxWidth = editorRect.width() / 3F
461461
val targetWidth = Math.min(scaledWidth, maxWidth)
462-
width = targetWidth.toInt()
462+
width = targetWidth.roundToInt()
463463

464464
lineNumberZoomLayout.layoutParams = this
465465
}

0 commit comments

Comments
 (0)