Correct bounding box calculation in wxGTK wxDC::DrawText().
Physical coordinates were incorrectly used to update the bounding box instead of the logical ones. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1335,7 +1335,9 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
|
|||||||
return true;
|
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") );
|
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -1343,8 +1345,8 @@ void wxWindowDCImpl::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
|
|
||||||
if (text.empty()) return;
|
if (text.empty()) return;
|
||||||
|
|
||||||
x = XLOG2DEV(x);
|
wxCoord x = XLOG2DEV(xLogical),
|
||||||
y = YLOG2DEV(y);
|
y = YLOG2DEV(yLogical);
|
||||||
|
|
||||||
wxCHECK_RET( m_context, wxT("no Pango context") );
|
wxCHECK_RET( m_context, wxT("no Pango context") );
|
||||||
wxCHECK_RET( m_layout, wxT("no Pango layout") );
|
wxCHECK_RET( m_layout, wxT("no Pango layout") );
|
||||||
@@ -1459,8 +1461,8 @@ void wxWindowDCImpl::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
pango_layout_set_attributes(m_layout, NULL);
|
pango_layout_set_attributes(m_layout, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CalcBoundingBox(x + int(w / m_scaleX), y + int(h / m_scaleY));
|
CalcBoundingBox(xLogical + int(w / m_scaleX), yLogical + int(h / m_scaleY));
|
||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(xLogical, yLogical);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: When GTK2.6 is required, merge DoDrawText and DoDrawRotatedText to
|
// TODO: When GTK2.6 is required, merge DoDrawText and DoDrawRotatedText to
|
||||||
|
Reference in New Issue
Block a user