Bug 131625 - Invalid object coordinates on resize of view object
Summary: Invalid object coordinates on resize of view object
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-01 01:15 UTC by Andrew Walker
Modified: 2006-08-01 17:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2006-08-01 01:15:03 UTC
Version:           HEAD (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:
Kst will crash when the user resizes a plot

STEPS TO REPRODUCE:
Start Kst
Create a single plot
Enter layout mode
Resize the plot from the lower centre resize point

RESULTS:
Crash
kst: kstviewobject.cpp:1464: virtual void KstViewObject::updateFromAspect(): Assertion `_geom.left() >= 0 && _geom.top() >= 0 && !_geom.size().isNull()' failed.
KCrash: Application 'kst' crashing...

EXPECTED RESULT:
The plot resizes correctly
Comment 1 George Staikos 2006-08-01 01:42:37 UTC
Appears to be related to the merge of the view aspect branch.   I will back out that merge if the fix isn't obvious.  I'm working on it.  It's really unfortunate that this stuff wasn't tested thoroughly while it was in the branch.  From now on I won't merge any branches unless they're fully tested.
Comment 2 Andrew Walker 2006-08-01 02:09:27 UTC
SVN commit 568394 by arwalker:

BUG:131625 Correctly normalize the new QRect

 M  +11 -0     kstgfxmousehandlerutils.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstgfxmousehandlerutils.cpp #568393:568394
@@ -152,6 +152,17 @@
       newSize.setRight(anchorPoint.x() - int(newHalfWidth));
     }
 
+  if (newSize.width() < 0) {
+    int width = newSize.width();
+    newSize.setLeft(newSize.left() + width);
+    newSize.setRight(width * -1);
+  }
+  if (newSize.height() < 0) {
+    int height = newSize.height();
+    newSize.setTop(newSize.top() + height);
+    newSize.setHeight(height * -1);
+  }
+      
     newSize = newSize.normalize();
 
     return newSize;
Comment 3 Duncan Hanson 2006-08-01 17:55:16 UTC
The problem is that KstViewObject::move is being called on the plot with
an invalid pos of (-1,0). I don't know where this call is originating
from, or why it's happening- can anyone more familiar with the
architecture explain?

Duncan.

On Mon, 2006-07-31 at 23:42 +0000, George Staikos wrote:
[bugs.kde.org quoted mail]