Skip to content
Discussion options

You must be logged in to vote

Yes, you can create an own action that extends CenterAction and register a custom command for your new action that takes a relative offset into account. So best look at the implementation of the CenterAction and adjust to your needs:

So you would create a new subclass of CenterAction and a subclass of CenterCommand (or BoundsAwareViewportCommand), register the command as linked above in your di.config.ts and adjust the implementation of your CenterCommand, e.g. as follows (see this.action.yourRelativeOffsetX and Y):

    getNewViewport(bounds: Bounds, model: SModelRoot): Viewport | undefined {
        if (!Dimension.isValid(model.c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tortmayr
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