Skip to content
Discussion options

You must be logged in to vote

Hi @rsoika,

yes this is possible. For this you need to customize the ZoomMouseListener and adapt the getZoomFactor()-Method
(https://github.com/eclipse-sprotty/sprotty/blob/fac2ef326044cb96c71e2b57d52a71e8345d80b5/packages/sprotty/src/features/viewport/zoom.ts#L99)

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.
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)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rsoika
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants