Skip to content

Commit 14e4822

Browse files
committed
fix crash
1 parent 52a8d88 commit 14e4822

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • library/src/main/java/de/markusressel/kodeeditor/library/compose

library/src/main/java/de/markusressel/kodeeditor/library/compose/KodeEditor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ fun KodeEditor(
109109
onOffsetChanged = {
110110
val newOffset = offset + (it / zoom)
111111
offset = newOffset.copy(
112-
x = newOffset.x.coerceIn(0f, maxXOffset),
113-
y = newOffset.y.coerceIn(0f, maxYOffset)
112+
x = newOffset.x.coerceIn(0f, maxXOffset.coerceAtLeast(0f)),
113+
y = newOffset.y.coerceIn(0f, maxYOffset.coerceAtLeast(0f)),
114114
)
115115
},
116116
onZoomChanged = {

0 commit comments

Comments
 (0)