const int w = bitmap.GetWidth();
const int h = bitmap.GetHeight();
+ // notice that as the bitmap is not drawn upside down (or right to left)
+ // even if the corresponding axis direction is inversed, we need to take it
+ // into account when calculating its bounding box
CalcBoundingBox(x, y);
- CalcBoundingBox(x + w, y + h);
+ CalcBoundingBox(x + m_signX*w, y + m_signY*h);
// device coords
int xx = LogicalToDeviceX(x);
return true;
}
-void wxWindowDCImpl::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
+void wxWindowDCImpl::DoDrawText(const wxString& text,
+ wxCoord xLogical,
+ wxCoord yLogical)
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (text.empty()) return;
- x = XLOG2DEV(x);
- y = YLOG2DEV(y);
+ wxCoord x = XLOG2DEV(xLogical),
+ y = YLOG2DEV(yLogical);
wxCHECK_RET( m_context, wxT("no Pango context") );
wxCHECK_RET( m_layout, wxT("no Pango layout") );
pango_layout_set_attributes(m_layout, NULL);
}
- CalcBoundingBox(x + int(w / m_scaleX), y + int(h / m_scaleY));
- CalcBoundingBox(x, y);
+ CalcBoundingBox(xLogical + int(w / m_scaleX), yLogical + int(h / m_scaleY));
+ CalcBoundingBox(xLogical, yLogical);
}
// TODO: When GTK2.6 is required, merge DoDrawText and DoDrawRotatedText to