avoid setting pango matrix when not needed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2013-08-12 16:24:42 +00:00
parent c8841d1493
commit 3e5a70b5d7

View File

@@ -1412,10 +1412,13 @@ void wxWindowDCImpl::DoDrawRotatedText(const wxString& text, int xLogical, int y
bg_col = m_textBackgroundColour.GetColor(); bg_col = m_textBackgroundColour.GetColor();
PangoMatrix matrix = PANGO_MATRIX_INIT; PangoMatrix matrix = PANGO_MATRIX_INIT;
if (!wxIsSameDouble(m_scaleX, 1) || !wxIsSameDouble(m_scaleY, 1) || !wxIsNullDouble(angle))
{
pango_matrix_scale(&matrix, m_scaleX, m_scaleY); pango_matrix_scale(&matrix, m_scaleX, m_scaleY);
pango_matrix_rotate (&matrix, angle); pango_matrix_rotate(&matrix, angle);
pango_context_set_matrix (m_context, &matrix); pango_context_set_matrix(m_context, &matrix);
pango_layout_context_changed (m_layout); pango_layout_context_changed(m_layout);
}
int w, h; int w, h;
pango_layout_get_pixel_size(m_layout, &w, &h); pango_layout_get_pixel_size(m_layout, &w, &h);