Skip to content

Node Shape issue when updating diagram using UpdateModelAction #440

Answered by tortmayr
sathya-1994 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sathya-1994
Short answer: To fix this issue you need to dispatch a RequestBoundsAction instead of an UpdateModelAction.
Explanation: The bounds (i.e size & width) of some components (e.g. labels) can not be computed on server-side because their actual size depends on how they are displayed & styled on client side. Therefore and update cycle in GLSP consists of the following flow:

  1. Server sends a RequestBoundsAction to the client
  2. Client computes the bounds (using sprotty's hidden rendering phase) and sends a ComputedBoundsAction to the server
  3. The client applies the received bound, optionally post-processes the model and then sends the UpdateModelAction to the client.

Steps 2 & 3 are a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sathya-1994
Comment options

Answer selected by sathya-1994
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