-
|
Hello, I wonder if it is possible to change the granularity of the zoom feature in GLSP (mouse wheel). === |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @rsoika, yes this is possible. For this you need to customize the Then simply rebind to your custom listener rebind(ZoomMouseListener).to(YourZoomListener).inSingletonScope()Keep in mind, that by default sprotty derives the zoom factor increments from the scroll wheel event. |
Beta Was this translation helpful? Give feedback.
Hi @rsoika,
yes this is possible. For this you need to customize the
ZoomMouseListenerand adapt thegetZoomFactor()-Method(https://github.com/eclipse-sprotty/sprotty/blob/fac2ef326044cb96c71e2b57d52a71e8345d80b5/packages/sprotty/src/features/viewport/zoom.ts#L99)
Then simply rebind to your custom listener
Keep in mind, that by default sprotty derives the zoom factor increments from the scroll wheel event.
This means that the zoom factor calculation might also behave slightly different depending on the used hardware (i.e. zooming granularity is also affected by the granularity of the used mouse)