Bug 160485 - [PATCH] KTuberling's saved files depend on window size
Summary: [PATCH] KTuberling's saved files depend on window size
Status: RESOLVED FIXED
Alias: None
Product: ktuberling
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-06 20:30 UTC by David Benjamin
Modified: 2008-04-15 21:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
keep the scene at a constant scale (12.71 KB, patch)
2008-04-06 20:31 UTC, David Benjamin
Details
revised patch (12.75 KB, patch)
2008-04-15 00:27 UTC, David Benjamin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Benjamin 2008-04-06 20:30:39 UTC
Version:           0.5.9 (using Devel)
Installed from:    Compiled sources
OS:                Linux

Steps to Reproduce:
1. Make a picture.
2. Save it.
3. Resize the window.
4. Reload the file.

I wrote a patch to fix this by making the scene constantly at the size of the SVG and resizing the view instead. This also simplifies the code considerably. The files are saved relative to the SVG's original dimensions.

To avoid breaking the old files, I bumped the save version, and if an old file is loaded, the positions are scaled, mimicking the old behavior.
Comment 1 David Benjamin 2008-04-06 20:31:07 UTC
Created attachment 24248 [details]
keep the scene at a constant scale
Comment 2 Albert Astals Cid 2008-04-14 22:18:53 UTC
Thanks a lot, but the patch breaks the "do not select items that are placed in the view and you click on transparent pixels of their boundingbox", namely by using itemAt() of the view instead the one of the scene and by removing contains() in ToDraw.

If you fix this i'll be happy to integrate your patch :-)
Comment 3 David Benjamin 2008-04-15 00:27:44 UTC
Created attachment 24330 [details]
revised patch

Hehe. Oops. I didn't notice that contains() managed more than just bounding.
:-)

Why does the view's itemAt not do what the view's does? It seems a bit odd.

Revised patch attached.
Comment 4 Albert Astals Cid 2008-04-15 21:18:44 UTC
SVN commit 797408 by aacid:

Patch from David Benjamin to fix loading only workng if you have the same size you had when saving (*ouch*)
Along with it comes some code refactoring that has the nice side effect of not needing the Qt4.4 ifdef anymore

BUGS: 160485


 M  +50 -79    playground.cpp  
 M  +1 -2      playground.h  
 M  +26 -41    todraw.cpp  
 M  +8 -3      todraw.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=797408