diff --git a/src/gfx/resample_text.cpp b/src/gfx/resample_text.cpp index bab28f46..9ba8bc1f 100644 --- a/src/gfx/resample_text.cpp +++ b/src/gfx/resample_text.cpp @@ -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);