From 9f8b35bfed6ee3d3bbecad1650fd2902c04c54c4 Mon Sep 17 00:00:00 2001 From: twanvl Date: Mon, 19 May 2008 17:47:02 +0000 Subject: [PATCH] Fixed shrink(-overflow) for rotated fields git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@871 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/field/text.cpp | 2 +- src/util/rotation.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/field/text.cpp b/src/data/field/text.cpp index 86f5ee84..122dd6e7 100644 --- a/src/data/field/text.cpp +++ b/src/data/field/text.cpp @@ -58,7 +58,7 @@ TextStyle::TextStyle(const TextFieldP& field) double TextStyle::getStretch() const { if (content_width > 0 && ((alignment() & ALIGN_STRETCH) || (alignment() & ALIGN_STRETCH_OVERFLOW))) { - double factor = (sideways(angle) ? double(height) : width - padding_left - padding_right) / content_width; + double factor = (width - padding_left - padding_right) / content_width; if (alignment() == ALIGN_STRETCH || factor < 1.0) { return factor; } diff --git a/src/util/rotation.cpp b/src/util/rotation.cpp index 7403c347..8e2a3336 100644 --- a/src/util/rotation.cpp +++ b/src/util/rotation.cpp @@ -135,9 +135,9 @@ wxRegion Rotation::trRectToRegion(const RealRect& r) const { RealPoint Rotation::trInv(const RealPoint& p) const { double a = deg_to_rad(angle), s = sin(a), c = cos(a); - double x = (p.x - origin.x) / zoomX, y = (p.y - origin.y) / zoomY; - return RealPoint(c * x - s * y, - s * x + c * y); + double x = p.x - origin.x, y = p.y - origin.y; + return RealPoint((c * x - s * y) / zoomX, + (s * x + c * y) / zoomY); } RealPoint Rotation::boundingBoxCorner(const RealSize& size) const {