|
Hello, I wonder if it is possible to change the granularity of the zoom feature in GLSP (mouse wheel). === |
Answered by
tortmayr
Nov 24, 2025
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. |
0 replies
Answer selected by
rsoika
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)