From 6b0a0fd098b97ed48b67782d38db98d967c35ec8 Mon Sep 17 00:00:00 2001 From: twanvl Date: Tue, 3 Jun 2008 21:25:53 +0000 Subject: [PATCH] Fixed positioning of shrunk text in rotated dcs git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@969 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/util/rotation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/rotation.cpp b/src/util/rotation.cpp index 8e2a3336..88371faa 100644 --- a/src/util/rotation.cpp +++ b/src/util/rotation.cpp @@ -209,15 +209,16 @@ void RotatedDC::DrawText (const String& text, const RealPoint& pos, AColor colo RealRect r(pos, GetTextExtent(text)); RealRect r_ext = trRectToBB(r); RealPoint pos2 = tr(pos); - if (zoomX != zoomY) { - r.width *= zoomX / zoomY; + stretch_ *= getStretch(); + if (fabs(stretch_ - 1) > 1e-6) { + r.width *= stretch_; RealRect r_ext2 = trRectToBB(r); pos2.x += r_ext2.x - r_ext.x; pos2.y += r_ext2.y - r_ext.y; r_ext.x = r_ext2.x; r_ext.y = r_ext2.y; } - draw_resampled_text(dc, pos2, r_ext, stretch_ * getStretch(), angle, color, text, blur_radius, boldness); + draw_resampled_text(dc, pos2, r_ext, stretch_, angle, color, text, blur_radius, boldness); } else if (quality >= QUALITY_SUB_PIXEL) { RealPoint p_ext = tr(pos)*text_scaling; double usx,usy;