Question about `androidx.compose.ui.input.mouse.Mo...
# compose-desktop
a
Question about
androidx.compose.ui.input.mouse.MouseScrollEvent
and
MouseScrollUnit
: I am using a
mouseScrollFilter
and am wanting to perform some mathematical operations using the
delta
(for zoom on scroll), but I can't seem to figure out how to get the actual value from the
delta
, there's no accessors or anything for the raw Float value. I understand there's the line/page scroll values but those don't seem accessible either, so not sure if I'm just thinking about this incorrectly.
i
there's no accessors or anything for the raw Float value
Usually there is no raw Float value (most of the mousses has discrete scroll; except maybe Magic mouse / touchpads)
there's no accessors or anything for the raw Float value
MouseScrollUnit is a sealed class, so you have to check every possible subclass:
Copy code
val zoomLevel += when (event.delta) {
  is MouseScrollUnit.Line -> value
  is MouseScrollUnit.Page -> value
}

val zoom = zoomLevelToZoomn(zoomLevel)
👌🏻 1
a
That clears up my confusion, thanks!