ls1intum / Apollon

UML Modeling Editor written in React
https://apollon-library.readthedocs.io
MIT License
65 stars 22 forks source link

Add initial support for canvas zooming #302

Closed matthiaslehnertum closed 10 months ago

matthiaslehnertum commented 11 months ago

This PR intends to extend the functionality of Apollon by the ability to zoom into the drawing canvas. For now, zooming is only possible via buttons on the canvas. Zooming via the trackpad has been excluded for now to reduce the increment size.

Checklist

Motivation and Context

This changes intends to solve the issues of element bounds being serialised including the scale factor at the moment which leads to issues when opening a diagram file in another Apollon instance with a different scale factor and leads to diagrams being exported wrongly from the conversion service if they have been serialised with any other scale factor than 1.0.

Description

The change adds zoom controls to the drawing canvas. The sequel PR https://github.com/ls1intum/Apollon/pull/307 then also removes all instances where the previous scale factor implementation was used.

Steps for Testing

To test the change, you can simply open up Apollon, drop a few elements on the drawing canvas and then use the zoom-in and zoom-out buttons the observe their effect.

Test Coverage

File Branch Line

Screenshots

Editor with the current default zoom of 0.8:

Screenshot 2023-10-04 at 11 06 25

Editor with the current minimum zoom factor of 0.5:

Screenshot 2023-10-04 at 11 06 30

Editor with a zoom factor of 1.6:

Screenshot 2023-10-04 at 11 06 43
matthiaslehnertum commented 10 months ago

Hey @AlexanderG2207 , thank you for your review. I addressed the issues accordingly. Could you check if the PR is fine for you like this?