Skip to content
Discussion options

You must be logged in to vote

Hi,

in general, you can get the current zoom level using the function getZoom(modelElement) which can be imported from import { getZoom } from '@eclipse-glsp/client';.

However, you will probably need to be notified on zoom level changes. So one approach could be to register an action handler for the SetViewportAction. Register it into the di module (di.config.ts):

configureActionHandler(context, SetViewportAction.KIND, YourActionHandler);

In this action handler you can obtain the current zoom level from the parameter newViewport from which you can obtain the zoom level and update it in the UI.

For the UI itself I would suggest to create a UIExtension which is plain HTML that can be static…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Abhay0294
Comment options

@planger
Comment options

@Abhay0294
Comment options

Answer selected by Abhay0294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants