From 69d59eb9e7473a63d584883e31d0814b93b00672 Mon Sep 17 00:00:00 2001 From: twanvl Date: Fri, 21 Sep 2007 17:57:23 +0000 Subject: [PATCH] Simpler implementation of stretch-overflow with rotation and alignment. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@734 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/field/text.hpp | 7 +------ src/util/rotation.cpp | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/data/field/text.hpp b/src/data/field/text.hpp index 0c4d3f98..c7ed4559 100644 --- a/src/data/field/text.hpp +++ b/src/data/field/text.hpp @@ -82,12 +82,7 @@ class TextStyle : public Style { /// The rotation to use when drawing inline Rotation getRotation() const { - double stretch = getStretch(); - if (sideways(angle)) { - return Rotation(angle, getRect(), stretch, 1/stretch); - } else { - return Rotation(angle, getRect(), 1.0, stretch); - } + return Rotation(angle, getRect(), 1.0, getStretch()); } /// The rotation to use when determining content layout, does not include the stretch factor inline Rotation getRotationNoStretch() const { diff --git a/src/util/rotation.cpp b/src/util/rotation.cpp index 59ad6e76..4fe38e8c 100644 --- a/src/util/rotation.cpp +++ b/src/util/rotation.cpp @@ -22,8 +22,8 @@ Rotation::Rotation(int angle, const RealRect& rect, double zoom, double strectch : angle(constrain_angle(angle)) , size(rect.size()) , origin(rect.position()) - , zoomX(zoom * strectch) - , zoomY(zoom) + , zoomX(::sideways(angle) ? zoom : zoom * strectch) + , zoomY(!::sideways(angle) ? zoom : zoom * strectch) { if (is_internal) { size = trNoNeg(size);