Bug 449621 - fit to screen after loading file
Summary: fit to screen after loading file
Status: RESOLVED DUPLICATE of bug 449622
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-04 21:42 UTC by Jessica
Modified: 2022-02-05 22:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
fit to screen (1.13 MB, application/xml)
2022-02-04 21:42 UTC, Jessica
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jessica 2022-02-04 21:42:49 UTC
Created attachment 146277 [details]
fit to screen

When loading an existing file, the diagram is not displayed fit to screen. It's displayed very tiny in the middle of the screen (unreadable) but this view has no real use. When an existing file is loaded, it should be fitted to the screen immediately after loading (same as option "fit").

Example file attached

OBSERVED RESULT
An existing file is not fitted to the screen when loading. 

EXPECTED RESULT
When an existing file is loaded, it should be fitted to the screen immediately after loading.
The user can choose  "fit (100%)"  later, when the screen was zoomed in/out by the user.


SOFTWARE/OS VERSIONS
Windows 10
git 37b9e8e
Comment 1 Oliver Kellogg 2022-02-04 21:55:30 UTC

*** This bug has been marked as a duplicate of bug 449622 ***
Comment 2 Oliver Kellogg 2022-02-05 22:53:15 UTC
It looks as though version 2.32 may produce some weird diagram coordinate values.
First line in <diagram>:

<diagram showopsig="1" [...] canvasheight="4.29497e+09" canvaswidth="4.29487e+09" 

The canvasheight and canvaswidth values are unusable.
By fortunate chance, the diagram loadFromXMI function happens to ignores these attributes.

However, there are also huge offsets on the x/y coordinates in the diagram  elements.
First <classwidget> in <diagram>:
<classwidget linecolor="#ff0000" [...] x="-95708.9" showattsigs="601" showstereotype="1" y="-36843.3" 

Looking at the x / y values of the further widgets, they all have a huge offset factor.

For the load code this would mean there would need to be an extra first pass which determines the minimum of all x and the minimum of all y values, and in the actual loading pass the minX / minY would need to be subtracted from the x / y values.
I'm not sure if and when I get around to implementing that - but there is a fairly simple workaround:
Select the arrow tool and draw a rectangle around the objects (group selection). Then move the group to the top left corner of the diagram.