Summary: | Problem with resizing while maintaining aspect ratio | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Andrew Walker
2006-08-02 19:43:35 UTC
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; |