Some more tweaks to rotated+shrunk text

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@872 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-05-19 19:02:29 +00:00
parent 9f8b35bfed
commit 3d802ed1aa
+3 -2
View File
@@ -187,8 +187,9 @@ void draw_resampled_text(DC& dc, const RealPoint& pos, const RealRect& rect, dou
// get image
mdc.SelectObject(wxNullBitmap);
// step 2. sample down
if (!sideways(angle)) w = int(w * stretch); // GCC makes annoying conversion warnings if *= is used here.
else h = int(h * stretch);
double ca = fabs(cos(deg_to_rad(angle))), sa = fabs(sin(deg_to_rad(angle)));
w += int(w * (stretch - 1) * ca); // GCC makes annoying conversion warnings if *= is used here.
h += int(h * (stretch - 1) * sa);
Image img_small(w, h, false);
fill_image(img_small, color);
downsample_to_alpha(buffer, img_small);