Arokip / flutter_diagram_editor

Fllutter diagram editor library
MIT License
116 stars 38 forks source link

Option for synchronizing main canvas with minimap's zoom and pan. #24

Closed shujaatak closed 3 years ago

shujaatak commented 3 years ago

I think it would be a useful option to add to minimap for synchronizing its zoom and pan with main canvas. Such as, when a user enables that option and then zoom or pan the minimap, the main canvas should also zoom or pan with the same amount.

Arokip commented 3 years ago

It's possible to use DiagramEditorContext.withSharedModelAndState() named contructor to have the same model and state (zoom and position) for both canvases.

The current demo app doesn't use this feature. It uses DiagramEditorContext.withSharedModel() for the minimap so only the diagram model is shared.