Version: HEAD (using KDE KDE 3.5.0) OS: Linux PROBLEM: If an object is resized while maintaining the aspect ratio the original size is not recovered STEPS TO REPRODUCE: Start Kst Create a plot within the default window Switch to layout mode Select the right central resize point While holding the shift key (to maintain the aspect ratio) drag the resize point to the left and back to its original position and then release the mouse button The previous step can be repeated several times RESULTS: The width of the plot has decreased EXPECTED RESULTS: The width of the plot should remain unchanged
This is kind of by design. The ideal aspect ratio is set whenever the user manually resizes the object. The idea was to make it possible for them to intentionally stretch an image out. The drawback is that it becomes possible for a (fairly determined) user to bork the image aspect. I suppose a reasonable workaround would be to only set _idealSize if the resize is done without +_maintainAspect. I'll try this out. dh. On Wed, 2006-08-02 at 17:43 +0000, Andrew Walker wrote: [bugs.kde.org quoted mail]
SVN commit 569026 by dhanson: BUG:131740 oh- nevermind, andrew's bug is different. i thought he was actually trying to resize the plots. here's the fix- those pesky 1's again introduced by the definition of width/height for QRects. M +4 -4 kstgfxmousehandlerutils.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kstgfxmousehandlerutils.cpp #569025:569026 @@ -114,8 +114,8 @@ if (maintainAspect) { double newHalfHeight = originalSize.height() * abs(newWidth) / originalSize.width() / 2.0; - newHalfHeight = kMin(double(movePoint.y() - bounds.top()), newHalfHeight); // ensure we are still within the bounds. - newHalfHeight = kMin(double(bounds.bottom() - movePoint.y()), newHalfHeight); + newHalfHeight = kMin(double(movePoint.y() - bounds.top() + 1), newHalfHeight); // ensure we are still within the bounds. + newHalfHeight = kMin(double(bounds.bottom() - movePoint.y() + 1), newHalfHeight); if (newWidth == 0) { // anything better to be done? newWidth = 1; @@ -136,8 +136,8 @@ if (maintainAspect) { double newHalfWidth = originalSize.width() * abs(newHeight) / originalSize.height() / 2.0; - newHalfWidth = kMin(double(movePoint.x() - bounds.left()), newHalfWidth); - newHalfWidth = kMin(double(bounds.right() - movePoint.x()), newHalfWidth); + newHalfWidth = kMin(double(movePoint.x() - bounds.left() + 1), newHalfWidth); + newHalfWidth = kMin(double(bounds.right() - movePoint.x() + 1), newHalfWidth); if (newHeight == 0) { newHeight = 1;