From 127874a7b90e2c3afc42d58b904da6b63db31a95 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sat, 9 Sep 2023 19:08:07 +0300 Subject: [PATCH] Fix bezier curves drawing in schematic/libedit. (cherry picked from commit ead44d58a0e1405349b4f4d2d1c582181557eef2) --- eeschema/sch_painter.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 2b27503569..5592ce0292 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -843,12 +843,9 @@ void SCH_PAINTER::draw( const LIB_SHAPE *aShape, int aLayer, bool aDimmed ) case SHAPE_T::BEZIER: { - std::deque mappedPts; - - for( const VECTOR2I& p : shape->GetBezierPoints() ) - mappedPts.push_back( mapCoords( p ) ); - - m_gal->DrawPolygon( mappedPts ); + m_gal->DrawCurve( + mapCoords( shape->GetStart() ), mapCoords( shape->GetBezierC1() ), + mapCoords( shape->GetBezierC2() ), mapCoords( shape->GetEnd() ) ); } break; @@ -1851,12 +1848,8 @@ void SCH_PAINTER::draw( const SCH_SHAPE* aShape, int aLayer ) case SHAPE_T::BEZIER: { - std::deque pts; - - for( const VECTOR2I &p : shape->GetPolyShape().Outline( 0 ).CPoints() ) - pts.push_back( p ); - - m_gal->DrawPolygon( pts ); + m_gal->DrawCurve( shape->GetStart(), shape->GetBezierC1(), shape->GetBezierC2(), + shape->GetEnd() ); break; }