Fix precision in wxGraphicsContext::{Stroke,Draw}Lines() under MSW.
Use floating point coordinates instead of ints which were used for some reason, resulting in a loss of precision. Closes #16187. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1489,11 +1489,11 @@ void wxGDIPlusContext::StrokeLines( size_t n, const wxPoint2DDouble *points)
|
|||||||
if ( !m_pen.IsNull() )
|
if ( !m_pen.IsNull() )
|
||||||
{
|
{
|
||||||
wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
|
wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
|
||||||
Point *cpoints = new Point[n];
|
PointF *cpoints = new PointF[n];
|
||||||
for (size_t i = 0; i < n; i++)
|
for (size_t i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
cpoints[i].X = (int)(points[i].m_x );
|
cpoints[i].X = static_cast<REAL>(points[i].m_x);
|
||||||
cpoints[i].Y = (int)(points[i].m_y );
|
cpoints[i].Y = static_cast<REAL>(points[i].m_y);
|
||||||
|
|
||||||
} // for (size_t i = 0; i < n; i++)
|
} // for (size_t i = 0; i < n; i++)
|
||||||
m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
|
m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
|
||||||
@@ -1507,11 +1507,11 @@ void wxGDIPlusContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPol
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
|
wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
|
||||||
Point *cpoints = new Point[n];
|
PointF *cpoints = new PointF[n];
|
||||||
for (size_t i = 0; i < n; i++)
|
for (size_t i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
cpoints[i].X = (int)(points[i].m_x );
|
cpoints[i].X = static_cast<REAL>(points[i].m_x);
|
||||||
cpoints[i].Y = (int)(points[i].m_y );
|
cpoints[i].Y = static_cast<REAL>(points[i].m_y);
|
||||||
|
|
||||||
} // for (int i = 0; i < n; i++)
|
} // for (int i = 0; i < n; i++)
|
||||||
if ( !m_brush.IsNull() )
|
if ( !m_brush.IsNull() )
|
||||||
|
Reference in New Issue
Block a user