Bug 480019

Summary: Bird's Eye View doesn't update from original document size
Product: [Applications] umbrello Reporter: Joseph Morgan <joe>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: minor CC: ralf.habacker
Priority: NOR    
Version: 2.33.2 (KDE releases 20.12.2)   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 2.39.2 (KDE releases 24.02.02)
Sentry Crash Report:
Attachments: xmi test case file
Screenshot with enabled debug option umbrello:UMLScene
xmi test case file

Description Joseph Morgan 2024-01-18 21:35:14 UTC
SUMMARY
When adding elements (to a class diagram anyway) outside of the original bounds of the view, the Bird's eye view does not compensate, making it impossible to scroll to view new components.   The main view can be zoomed our, but, if the class diagram is large, zooming only seems to be focused exactly center, requiring scrolling via the Bird's Eye view.


STEPS TO REPRODUCE
1. Create a class diagram.
2. Drop a large number of classes into it such that the bounds of the default page size are well exceeded.
3. Try to use the bird's eye view.  

OBSERVED RESULT
One can only scroll to what's in the original bounds. 


EXPECTED RESULT
The bounds of the Bird's Eye view should compensate few newly added elements.

SOFTWARE/OS VERSIONS
Ubuntu 22.04
Umbrello 2.38.3 (the version list above needs to be updated)
QT Version 5.15.11
KDE Frameworks 5.111.0


ADDITIONAL INFORMATION
A work-around is to save and close the diagram and then reopen it.  As long as the elements remain within the original bounds, everything is fine.  But if one adds or moves an element outside of the original bounds, the problem exists.
Comment 1 Ralf Habacker 2024-02-29 23:25:20 UTC
The problem is probably that the scene rectangle does not match the bounding rectangle of the contained elements. You can check this by activating 'umbrello:UMLScene' in the debug view. If the debug view is not visible, you can show it by right-clicking on the menu bar of the application and activating 'Debug'. A green rectangle will then appear in a diagram showing the current dimensions of the scene rectangle. A blue rectangle is drawn for the dimensions of the contained elements.
Comment 2 Joseph Morgan 2024-03-07 14:13:41 UTC
Sorry it took so long for me to get back to this.   My debug is on (apparently always was).  I see the blue rectangle, but not the green one.

Could it be because I'm using Ubuntu here?
Comment 3 Ralf Habacker 2024-03-07 21:11:35 UTC
Created attachment 166636 [details]
xmi test case file
Comment 4 Ralf Habacker 2024-03-07 21:14:00 UTC
Created attachment 166637 [details]
Screenshot with enabled debug option umbrello:UMLScene
Comment 5 Ralf Habacker 2024-03-07 21:17:11 UTC
(In reply to Joseph Morgan from comment #2)
> Sorry it took so long for me to get back to this.   My debug is on
> (apparently always was).  I see the blue rectangle, but not the green one.

You should be able to see the green rectangle after loading the appended xmi test file as shown in the appended screenshot.

> Could it be because I'm using Ubuntu here?

Probably no, it depends on the xmi file you loaded.
Comment 6 Ralf Habacker 2024-03-07 21:23:59 UTC
Created attachment 166638 [details]
xmi test case file
Comment 7 Ralf Habacker 2024-03-07 21:44:54 UTC
This issue appears to be an unresolved problem in trying to resolve the issues described in bug 446020 .
Comment 8 Joseph Morgan 2024-03-07 21:49:27 UTC
OK.  Got it now!  Thanks.

I can drag a class from a class diagram all the way outside the green rectangle.  The blue one expands, but not the green.  I can never drag the blue rectangle in the Bird's Eye View beyond the bounds of the green rectangle as shown in the class diagram.

Thanks for the update, as well, on it being an unresolved issue and not so much having to do with Ubuntu.

The good news is, there is a work around.   Thanks again.
Comment 9 Ralf Habacker 2024-03-07 23:00:31 UTC
(In reply to Joseph Morgan from comment #8)
> The good news is, there is a work around.

Another workaround is to open the diagram settings dialogue box and adjust the size of the diagram, which can also be helpful. However, there are also restrictions here, see https://bugs.kde.org/show_bug.cgi?id=446020#c8
Comment 10 Ralf Habacker 2024-03-27 10:35:47 UTC
Git commit bccb5f391ae2caaee518ab4ada7651b6b2522c3f by Ralf Habacker.
Committed on 27/03/2024 at 10:35.
Pushed by habacker into branch 'release/24.02'.

umbrello/diagram_utils.{h,cpp}: Restructured in preparation for troubleshooting

- Outsourcing the actual working parts of importGraph() to
  importClassGraph()
- Rename the parameter fileName into sourceHint, as not only
  file names are specified here

M  +28   -26   umbrello/diagram_utils.cpp
M  +3    -2    umbrello/diagram_utils.h

https://invent.kde.org/sdk/umbrello/-/commit/bccb5f391ae2caaee518ab4ada7651b6b2522c3f
Comment 11 Ralf Habacker 2024-03-27 10:35:55 UTC
Git commit 0f9884eb5325b41e40aa03257464ad43d5065dce by Ralf Habacker.
Committed on 27/03/2024 at 10:35.
Pushed by habacker into branch 'release/24.02'.

Correct inappropriate scrollbars after importing graphs into a diagram

When importing graphs into a class or sequence diagram, the extent of the
scene was too small, so that it was not possible to scroll over the entire
elements.

umbrello/diagram_utils.cpp:
- in importGraph() update scene rect

umbrello/umlscene.{h,cpp}:
- add static constant s_sceneBorder
- add method updateSceneRect()
FIXED-IN: 2.39.2 (KDE releases 24.02.02)

M  +2    -0    umbrello/diagram_utils.cpp
M  +10   -0    umbrello/umlscene.cpp
M  +2    -0    umbrello/umlscene.h

https://invent.kde.org/sdk/umbrello/-/commit/0f9884eb5325b41e40aa03257464ad43d5065dce