From fb848b4ae58443da376f007171a42bee42a71b3e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 21 Sep 2005 11:53:53 +0000 Subject: [PATCH] fix scaling of PS text output when X and Y scale are different svn: r895 --- src/wxcommon/PSDC.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/wxcommon/PSDC.cxx b/src/wxcommon/PSDC.cxx index 4e423a6c28..08eb18dfff 100644 --- a/src/wxcommon/PSDC.cxx +++ b/src/wxcommon/PSDC.cxx @@ -967,7 +967,7 @@ void wxPostScriptDC::SetFont (wxFont * the_font) size = current_font->GetPointSize(); next_font_name = name; - next_font_size = YSCALEREL(size); + next_font_size = size; } static void set_pattern(wxPostScriptDC *dc, wxPSStream *pstream, wxBitmap *bm, int rop, wxColour *col) @@ -1368,20 +1368,27 @@ void wxPostScriptDC::DrawText(DRAW_TEXT_CONST char *text, double x, double y, if (angle != 0.0) { pstream->Out(XSCALE(x)); pstream->Out(" "); pstream->Out(YSCALE(y)); pstream->Out(" translate\n"); + if ((user_scale_x != 1) || (user_scale_y != 1)) { + pstream->Out(user_scale_x); pstream->Out(" "); pstream->Out(user_scale_y); pstream->Out(" scale\n"); + } pstream->Out(angle * 180 / pie); pstream->Out(" rotate 0 "); - pstream->Out(YSCALEREL(-size)); + pstream->Out(-size); pstream->Out(" moveto\n"); } else { pstream->Out(XSCALE(x)); pstream->Out(" "); pstream->Out(YSCALE(y + size)); pstream->Out(" moveto\n"); + if ((user_scale_x != 1) || (user_scale_y != 1)) { + pstream->Out("gsave\n"); + pstream->Out(user_scale_x); pstream->Out(" "); pstream->Out(user_scale_y); pstream->Out(" scale\n"); + } } sym_map = current_font->GetFamily() == wxSYMBOL; wxPostScriptDrawText((Scheme_Object *)pstream->f, name, text, dt, combine, use16, current_font_size, sym_map); - if (angle != 0.0) { + if ((angle != 0.0) || (user_scale_x != 1) || (user_scale_y != 1)) { pstream->Out("grestore\n"); }