Commit 414a1d9e authored by twanvl's avatar twanvl

Some more tweaks to rotated+shrunk text

parent fc6b0136
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment