mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-20 22:06:25 +08:00
wxMSW: Fix drawing vertical lines with pen width > 1 in RTL layout
Shift them to account for an offset when using RTL. Closes #26448.
This commit is contained in:
committed by
Vadim Zeitlin
parent
9006641fb1
commit
5e66fb7d2e
+12
-1
@@ -718,7 +718,18 @@ void wxMSWDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
||||
}
|
||||
else
|
||||
{
|
||||
wxDrawLine(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2));
|
||||
int dx = 0;
|
||||
|
||||
// In RTL layout, we need this adjustment because vertical lines drawn
|
||||
// with pen width > 1 are incorrectly shifted to the left by one pixel.
|
||||
if ( x1 == x2 && y1 != y2 &&
|
||||
m_pen.GetWidth() > 1 &&
|
||||
GetLayoutDirection() == wxLayout_RightToLeft )
|
||||
{
|
||||
dx = -1;
|
||||
}
|
||||
|
||||
wxDrawLine(GetHdc(), XLOG2DEV(x1) + dx, YLOG2DEV(y1), XLOG2DEV(x2) + dx, YLOG2DEV(y2));
|
||||
}
|
||||
|
||||
if ( AreAutomaticBoundingBoxUpdatesEnabled() )
|
||||
|
||||
Reference in New Issue
Block a user