Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Save and restore diagram position and zoom

$
0
0

@Dominic.Lerbs wrote:

Hi,

I have a diagram which displays different models.
To switch between models, I basically call diagram.clear() and diagram.model = xyz
I need diagram.clear() as I have custom parts in the diagram which are not part of the model.

For each model, I am saving the position and scale in the "ViewportBoundsChanged" event listener and restoring it when the model is loaded again.

I don’t know if this recently changed, but in the latest goJS version the diagram.clear() event will also trigger the "ViewportBoundsChanged" event with a different position. This will overwrite the last correct model position.

Is there any other way I can use to save the diagram position/scale or some way to ignore the "ViewportBoundsChanged" in case it is triggered by diagram.clear()?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles