Bug 321581 - widgets floating point coordinates are loaded as int
Summary: widgets floating point coordinates are loaded as int
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-24 22:27 UTC by Ralf Habacker
Modified: 2013-06-26 10:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.90


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2013-06-24 22:27:14 UTC
Widgets and associations located on a class diagram uses float coordinates, which are also saved as float coordinates into xmi files. When loading xmi files those coordinates are loaded as int values, which may results in wrong positions of widgets and/or assocation line points. 

https://projects.kde.org/projects/kde/kdesdk/umbrello/repository/revisions/master/entry/umbrello/widgets/umlwidget.cpp#L1294

https://projects.kde.org/projects/kde/kdesdk/umbrello/repository/revisions/master/entry/umbrello/widgets/associationline.cpp#L440


Reproducible: Always

Steps to Reproduce:
1. open umbrello
2. place two classes 
3. create an assocation between them 
4. autolayout vertically  
5. add several line points 
6. save as xmi file
7. reload xmi file

Actual Results:  
some line points may be displayed on a different place. 


Expected Results:  
line points should be displayed after loading as initial entered
 

There may be two possible solutions: 
1. save coordinates as int values 
2. load as float coordinates
Comment 1 Andi Fischer 2013-06-25 07:21:47 UTC
Use solution 2.
Reason: Graphics View Framework uses floating point precision.
See: http://qt-project.org/doc/qt-4.8/graphicsview.html#performance
Comment 2 Ralf Habacker 2013-06-25 07:57:57 UTC
Git commit ed108d8437c5b5d542613745d0579f0ada0cffb6 by Ralf Habacker.
Committed on 24/06/2013 at 21:57.
Pushed by habacker into branch 'master'.

Fixed bug removing the fractional digits when load widgets coordinates from xmi file.

M  +6    -6    umbrello/widgets/associationline.cpp
M  +2    -2    umbrello/widgets/floatingdashlinewidget.cpp
M  +2    -2    umbrello/widgets/messagewidget.cpp
M  +3    -3    umbrello/widgets/umlwidget.cpp

http://commits.kde.org/umbrello/ed108d8437c5b5d542613745d0579f0ada0cffb6