Bug 160485

Summary: [PATCH] KTuberling's saved files depend on window size
Product: [Applications] ktuberling Reporter: David Benjamin <davidben>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: keep the scene at a constant scale
revised patch

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