void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetSize(width, height);
}
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
wxCoord wxWindowDCImpl::GetCharHeight() const
{
PangoFontMetrics *metrics = pango_context_get_metrics (m_context, m_fontdesc, pango_context_get_language(m_context));
- wxCHECK_MSG( metrics, -1, _T("failed to get pango font metrics") );
+ wxCHECK_MSG( metrics, -1, wxT("failed to get pango font metrics") );
wxCoord h = PANGO_PIXELS (pango_font_metrics_get_descent (metrics) +
pango_font_metrics_get_ascent (metrics));
wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *win )
: wxWindowDCImpl( owner, win )
{
- wxCHECK_RET( win, _T("NULL window in wxClientDCImpl::wxClientDC") );
+ wxCHECK_RET( win, wxT("NULL window in wxClientDCImpl::wxClientDC") );
#ifdef __WXUNIVERSAL__
wxPoint ptOrigin = win->GetClientAreaOrigin();
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetClientSize( width, height );
}