From 3a4ad0fb8ba302e8f9ac551fe45456b4064c3fc8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 1 May 2025 16:46:58 +0100 Subject: [PATCH] Cleanup. --- common/plotters/DXF_plotter.cpp | 17 ++-- common/plotters/HPGL_plotter.cpp | 15 ++-- common/plotters/PDF_plotter.cpp | 141 +++++++++++++++++++++---------- common/plotters/PS_plotter.cpp | 58 +++++++++---- common/plotters/plotter.cpp | 40 ++++----- 5 files changed, 177 insertions(+), 94 deletions(-) diff --git a/common/plotters/DXF_plotter.cpp b/common/plotters/DXF_plotter.cpp index 2203307b85..a22fdcd374 100644 --- a/common/plotters/DXF_plotter.cpp +++ b/common/plotters/DXF_plotter.cpp @@ -570,10 +570,8 @@ void DXF_PLOTTER::PlotPoly( const std::vector& aCornerList, FILL_T aFi } // enter the initial polygon: - for( unsigned ii = 0; ii < aCornerList.size(); ii++ ) - { - bufferPolybase.Append( aCornerList[ii] ); - } + for( const VECTOR2I& corner : aCornerList ) + bufferPolybase.Append( corner ); // Merge polygons to build the polygon which contains the initial // polygon and its thick outline @@ -635,11 +633,12 @@ void DXF_PLOTTER::PenTo( const VECTOR2I& pos, char plume ) wxString cname = getDXFColorName( m_currentColor ); const char* lname = getDXFLineType( static_cast( m_currentLineType ) ); fmt::print( m_outputFile, "0\nLINE\n8\n{}\n6\n{}\n10\n{}\n20\n{}\n11\n{}\n21\n{}\n", - TO_UTF8( cname ), lname, - formatCoord( pen_lastpos_dev.x ), - formatCoord( pen_lastpos_dev.y ), - formatCoord( pos_dev.x ), - formatCoord( pos_dev.y ) ); + TO_UTF8( cname ), + lname, + formatCoord( pen_lastpos_dev.x ), + formatCoord( pen_lastpos_dev.y ), + formatCoord( pos_dev.x ), + formatCoord( pos_dev.y ) ); } m_penLastpos = pos; diff --git a/common/plotters/HPGL_plotter.cpp b/common/plotters/HPGL_plotter.cpp index 4b8b2ead4a..c462ad488c 100644 --- a/common/plotters/HPGL_plotter.cpp +++ b/common/plotters/HPGL_plotter.cpp @@ -511,7 +511,9 @@ void HPGL_PLOTTER::PenTo( const VECTOR2I& pos, char plume ) else if( plume == 'D' ) { m_penState = 'D'; - startOrAppendItem( lastpos_dev, fmt::format( "PA {:.0f},{:.0f};", pos_dev.x, pos_dev.y ) ); + startOrAppendItem( lastpos_dev, fmt::format( "PA {:.0f},{:.0f};", + pos_dev.x, + pos_dev.y ) ); m_current_item->loc_end = pos_dev; m_current_item->bbox.Merge( pos_dev ); } @@ -657,7 +659,10 @@ void HPGL_PLOTTER::FlashPadCircle( const VECTOR2I& pos, int diametre, // Plot filled area and its outline startOrAppendItem( userToDeviceCoordinates( VECTOR2I( pos.x + radius, pos.y ) ), fmt::format( "PM 0; PA {:.0f},{:.0f};CI {:.0f};{}", - pos_dev.x, pos_dev.y, rsize, hpgl_end_polygon_cmd ) ); + pos_dev.x, + pos_dev.y, + rsize, + hpgl_end_polygon_cmd ) ); m_current_item->lift_before = true; m_current_item->pen_returns = true; } @@ -701,10 +706,10 @@ void HPGL_PLOTTER::FlashPadRect( const VECTOR2I& aPos, const VECTOR2I& aPadSize, // Close polygon corners.emplace_back( - dx, - dy ); - for( unsigned ii = 0; ii < corners.size(); ii++ ) + for( VECTOR2I& corner : corners ) { - RotatePoint( corners[ii], aOrient ); - corners[ii] += aPos; + RotatePoint( corner, aOrient ); + corner += aPos; } PlotPoly( corners, aTraceMode == FILLED ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL ); diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 18c32a24b3..0836bbe9a5 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -192,25 +192,32 @@ void PDF_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { case LINE_STYLE::DASH: fmt::println( m_workFile, "[{} {}] 0 d", - (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDashMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; case LINE_STYLE::DOT: fmt::println( m_workFile, "[{} {}] 0 d", - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; case LINE_STYLE::DASHDOT: fmt::println( m_workFile, "[{} {} {} {}] 0 d", - (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDashMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ), + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; case LINE_STYLE::DASHDOTDOT: fmt::println( m_workFile, "[{} {} {} {} {} {}] 0 d", - (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDashMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ), + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ), + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; default: @@ -265,8 +272,12 @@ void PDF_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int else paintOp = width > 0 ? 'B' : 'f'; - fmt::println( m_workFile, "{:g} {:g} {:g} {:g} re {}", p1_dev.x, p1_dev.y, p2_dev.x - p1_dev.x, - p2_dev.y - p1_dev.y, paintOp ); + fmt::println( m_workFile, "{:g} {:g} {:g} {:g} re {}", + p1_dev.x, + p1_dev.y, + p2_dev.x - p1_dev.x, + p2_dev.y - p1_dev.y, + paintOp ); } @@ -493,8 +504,7 @@ void PDF_PLOTTER::PlotImage( const wxImage& aImage, const VECTOR2I& aPos, double if( memcmp( image.GetData(), aCurrImage.GetData(), pixCount * 3 ) != 0 ) continue; - if( image.HasAlpha() - && memcmp( image.GetAlpha(), aCurrImage.GetAlpha(), pixCount ) != 0 ) + if( image.HasAlpha() && memcmp( image.GetAlpha(), aCurrImage.GetAlpha(), pixCount ) != 0 ) continue; return imgHandle; @@ -522,9 +532,10 @@ void PDF_PLOTTER::PlotImage( const wxImage& aImage, const VECTOR2I& aPos, double 4) profit */ fmt::println( m_workFile, "q {:g} 0 0 {:g} {:g} {:g} cm", // Step 1 - userToDeviceSize( drawsize.x ), - userToDeviceSize( drawsize.y ), - dev_start.x, dev_start.y ); + userToDeviceSize( drawsize.x ), + userToDeviceSize( drawsize.y ), + dev_start.x, + dev_start.y ); fmt::println( m_workFile, "/Im{} Do", imgHandle ); fmt::println( m_workFile, "Q" ); @@ -572,12 +583,16 @@ int PDF_PLOTTER::startPdfStream( int handle ) if( ADVANCED_CFG::GetCfg().m_DebugPDFWriter ) { - fmt::println( m_outputFile, "<< /Length {} 0 R >>\nstream", + fmt::println( m_outputFile, + "<< /Length {} 0 R >>\n" + "stream", handle + 1 ); } else { - fmt::println( m_outputFile, "<< /Length {} 0 R /Filter /FlateDecode >>\nstream", + fmt::println( m_outputFile, + "<< /Length {} 0 R /Filter /FlateDecode >>\n" + "stream", handle + 1 ); } @@ -663,12 +678,16 @@ void PDF_PLOTTER::StartPage( const wxString& aPageNumber, const wxString& aPageN wxASSERT( !m_workFile ); m_pageNumbers.push_back( aPageNumber ); - m_pageName = aPageName.IsEmpty() - ? wxString::Format( _( "Page %s" ), aPageNumber ) - : wxString::Format( _( "%s (Page %s)" ), aPageName, aPageNumber ); - m_parentPageName = aParentPageName.IsEmpty() - ? wxString::Format( _( "Page %s" ), aParentPageNumber ) - : wxString::Format( _( "%s (Page %s)" ), aParentPageName, aParentPageNumber ); + m_pageName = aPageName.IsEmpty() ? wxString::Format( _( "Page %s" ), + aPageNumber ) + : wxString::Format( _( "%s (Page %s)" ), + aPageName, + aPageNumber ); + m_parentPageName = aParentPageName.IsEmpty() ? wxString::Format( _( "Page %s" ), + aParentPageNumber ) + : wxString::Format( _( "%s (Page %s)" ), + aParentPageName, + aParentPageNumber ); // Compute the paper size in IUs m_paperSize = m_pageInfo.GetSizeMils(); @@ -1008,9 +1027,13 @@ int PDF_PLOTTER::emitGoToAction( int aPageHandle, const VECTOR2I& aBottomLeft, startPdfObject( actionHandle ); fmt::print( m_outputFile, - "<>\n", - aPageHandle, aBottomLeft.x, aBottomLeft.y, aTopRight.x, aTopRight.y ); + "<>\n", + aPageHandle, + aBottomLeft.x, + aBottomLeft.y, + aTopRight.x, + aTopRight.y ); closePdfObject(); @@ -1024,9 +1047,9 @@ int PDF_PLOTTER::emitGoToAction( int aPageHandle ) startPdfObject( actionHandle ); fmt::println( m_outputFile, - "<>", - aPageHandle ); + "<>", + aPageHandle ); closePdfObject(); @@ -1170,8 +1193,12 @@ bool PDF_PLOTTER::EndPlot() { fontdefs[i].font_handle = startPdfObject(); fmt::println( m_outputFile, - "<< /BaseFont {}\n /Type /Font\n /Subtype /Type1\n /Encoding /WinAnsiEncoding\n>>", - fontdefs[i].psname ); + "<< /BaseFont {}\n" + " /Type /Font\n" + " /Subtype /Type1\n" + " /Encoding /WinAnsiEncoding\n" + ">>", + fontdefs[i].psname ); closePdfObject(); } @@ -1221,7 +1248,9 @@ bool PDF_PLOTTER::EndPlot() "/Height {}\n" "/Filter /FlateDecode\n" "/Length {} 0 R\n", // Length is deferred - m_colorMode ? "/DeviceRGB" : "/DeviceGray", image.GetWidth(), image.GetHeight(), + m_colorMode ? "/DeviceRGB" : "/DeviceGray", + image.GetWidth(), + image.GetHeight(), imgLenHandle ); if( smaskHandle != -1 ) @@ -1267,7 +1296,9 @@ bool PDF_PLOTTER::EndPlot() "/Length {} 0 R\n" "/Filter /FlateDecode\n" ">>\n", // Length is deferred - image.GetWidth(), image.GetHeight(), smaskLenHandle ); + image.GetWidth(), + image.GetHeight(), + smaskLenHandle ); fmt::println( m_outputFile, "stream" ); @@ -1307,7 +1338,10 @@ bool PDF_PLOTTER::EndPlot() "/Subtype /Link\n" "/Rect [{:g} {:g} {:g} {:g}]\n" "/Border [16 16 0]\n", - box.GetLeft(), box.GetBottom(), box.GetRight(), box.GetTop() ); + box.GetLeft(), + box.GetBottom(), + box.GetRight(), + box.GetTop() ); wxString pageNumber; bool pageFound = false; @@ -1544,16 +1578,30 @@ function ShM(aEntries) { if( outlineHandle > 0 ) { fmt::println( m_outputFile, - "<<\n/Type /Catalog\n/Pages {} 0 R\n/Version /1.5\n/PageMode /UseOutlines\n/Outlines {} 0 R\n/Names {} 0 R\n/PageLayout /SinglePage\n>>", - m_pageTreeHandle, - outlineHandle, - m_jsNamesHandle ); + "<<\n" + "/Type /Catalog\n" + "/Pages {} 0 R\n" + "/Version /1.5\n" + "/PageMode /UseOutlines\n" + "/Outlines {} 0 R\n" + "/Names {} 0 R\n" + "/PageLayout /SinglePage\n" + ">>", + m_pageTreeHandle, + outlineHandle, + m_jsNamesHandle ); } else { fmt::println( m_outputFile, - "<<\n/Type /Catalog\n/Pages {} 0 R\n/Version /1.5\n/PageMode /UseNone\n/PageLayout /SinglePage\n>>", - m_pageTreeHandle ); + "<<\n" + "/Type /Catalog\n" + "/Pages {} 0 R\n" + "/Version /1.5\n" + "/PageMode /UseNone\n" + "/PageLayout /SinglePage\n" + ">>", + m_pageTreeHandle ); } closePdfObject(); @@ -1565,7 +1613,8 @@ function ShM(aEntries) { fmt::print( m_outputFile, "xref\n" "0 {}\n" - "0000000000 65535 f \n", m_xrefTable.size() ); + "0000000000 65535 f \n", + m_xrefTable.size() ); for( unsigned i = 1; i < m_xrefTable.size(); i++ ) { @@ -1579,7 +1628,10 @@ function ShM(aEntries) { "startxref\n" "{}\n" // The offset we saved before "%%EOF\n", - m_xrefTable.size(), catalogHandle, infoDictHandle, xref_start ); + m_xrefTable.size(), + catalogHandle, + infoDictHandle, + xref_start ); fclose( m_outputFile ); m_outputFile = nullptr; @@ -1685,8 +1737,11 @@ void PDF_PLOTTER::Text( const VECTOR2I& aPos, for the trig part of the matrix to avoid %g going in exponential format (which is not supported) */ fmt::print( m_workFile, "q {:f} {:f} {:f} {:f} {:f} {:f} cm BT {} {:g} Tf {} Tr {:g} Tz ", - ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f, - fontname, heightFactor, render_mode, wideningFactor * 100 ); + ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f, + fontname, + heightFactor, + render_mode, + wideningFactor * 100 ); std::string txt_pdf = encodeStringForPlotter( word ); fmt::println( m_workFile, "{} Tj ET", txt_pdf ); diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index c4aa06b7ed..4d2ad1e574 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -466,25 +466,32 @@ void PS_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { case LINE_STYLE::DASH: fmt::print( m_outputFile, "[{} {}] 0 setdash\n", - (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDashMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; case LINE_STYLE::DOT: fmt::print( m_outputFile, "[{} {}] 0 setdash\n", - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; case LINE_STYLE::DASHDOT: fmt::print( m_outputFile, "[{} {} {} {}] 0 setdash\n", - (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDashMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ), + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; case LINE_STYLE::DASHDOTDOT: fmt::print( m_outputFile, "[{} {} {} {} {} {}] 0 setdash\n", - (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), - (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); + (int) GetDashMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ), + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ), + (int) GetDotMarkLenIU( aLineWidth ), + (int) GetDashGapLenIU( aLineWidth ) ); break; default: @@ -503,8 +510,12 @@ void PS_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int VECTOR2D p1_dev = userToDeviceCoordinates( p1 ); VECTOR2D p2_dev = userToDeviceCoordinates( p2 ); - fmt::print( m_outputFile, "{:g} {:g} {:g} {:g} rect{}\n", p1_dev.x, p1_dev.y, - p2_dev.x - p1_dev.x, p2_dev.y - p1_dev.y, getFillId( fill ) ); + fmt::print( m_outputFile, "{:g} {:g} {:g} {:g} rect{}\n", + p1_dev.x, + p1_dev.y, + p2_dev.x - p1_dev.x, + p2_dev.y - p1_dev.y, + getFillId( fill ) ); } @@ -519,7 +530,11 @@ void PS_PLOTTER::Circle( const VECTOR2I& pos, int diametre, FILL_T fill, int wid VECTOR2D pos_dev = userToDeviceCoordinates( pos ); double radius = userToDeviceSize( diametre / 2.0 ); - fmt::print( m_outputFile, "{:g} {:g} {:g} cir{}\n", pos_dev.x, pos_dev.y, radius, getFillId( fill ) ); + fmt::print( m_outputFile, "{:g} {:g} {:g} cir{}\n", + pos_dev.x, + pos_dev.y, + radius, + getFillId( fill ) ); } @@ -549,8 +564,13 @@ void PS_PLOTTER::Arc( const VECTOR2D& aCenter, const EDA_ANGLE& aStartAngle, SetCurrentLineWidth( aWidth ); - fmt::print( m_outputFile, "{:g} {:g} {:g} {:g} {:g} arc{}\n", center_device.x, center_device.y, - radius_device, startAngle.AsDegrees(), endAngle.AsDegrees(), getFillId( aFill ) ); + fmt::print( m_outputFile, "{:g} {:g} {:g} {:g} {:g} arc{}\n", + center_device.x, + center_device.y, + radius_device, + startAngle.AsDegrees(), + endAngle.AsDegrees(), + getFillId( aFill ) ); } @@ -713,7 +733,8 @@ void PS_PLOTTER::PenTo( const VECTOR2I& pos, char plume ) { VECTOR2D pos_dev = userToDeviceCoordinates( pos ); fmt::print( m_outputFile, "{:g} {:g} {}to\n", - pos_dev.x, pos_dev.y, + pos_dev.x, + pos_dev.y, ( plume=='D' ) ? "line" : "move" ); } @@ -804,8 +825,8 @@ bool PS_PLOTTER::StartPlot( const wxString& aPageNumber ) } fmt::print( m_outputFile, "%%BoundingBox: 0 0 {} {}\n", - (int) ceil( psPaperSize.x * BIGPTsPERMIL ), - (int) ceil( psPaperSize.y * BIGPTsPERMIL ) ); + (int) ceil( psPaperSize.x * BIGPTsPERMIL ), + (int) ceil( psPaperSize.y * BIGPTsPERMIL ) ); // Specify the size of the sheet and the name associated with that size. // (If the "User size" option has been selected for the sheet size, @@ -865,7 +886,7 @@ bool PS_PLOTTER::StartPlot( const wxString& aPageNumber ) // Set default line width fmt::print( m_outputFile, "{:g} setlinewidth\n", - userToDeviceSize( m_renderSettings->GetDefaultPenWidth() ) ); + userToDeviceSize( m_renderSettings->GetDefaultPenWidth() ) ); fmt::print( m_outputFile, "%%EndPageSetup\n" ); return true; @@ -933,7 +954,10 @@ void PS_PLOTTER::PlotText( const VECTOR2I& aPos, { std::string ps_test = encodeStringForPlotter( aText ); VECTOR2D pos_dev = userToDeviceCoordinates( aPos ); - fmt::print( m_outputFile, "{} {:g} {:g} phantomshow\n", ps_test, pos_dev.x, pos_dev.y ); + fmt::print( m_outputFile, "{} {:g} {:g} phantomshow\n", + ps_test, + pos_dev.x, + pos_dev.y ); } PLOTTER::PlotText( aPos, aColor, aText, aAttributes, aFont, aFontMetrics, aData ); diff --git a/common/plotters/plotter.cpp b/common/plotters/plotter.cpp index c2c80c894f..351fc28590 100644 --- a/common/plotters/plotter.cpp +++ b/common/plotters/plotter.cpp @@ -531,10 +531,10 @@ void PLOTTER::sketchOval( const VECTOR2I& aPos, const VECTOR2I& aSize, const EDA corners.emplace_back( 0, -half_height ); // Rotate and move to the actual position - for( size_t ii = 0; ii < corners.size(); ii++ ) + for( VECTOR2I& corner : corners ) { - RotatePoint( corners[ii], orient ); - corners[ii] += aPos; + RotatePoint( corner, orient ); + corner += aPos; } // Gen shape (2 lines and 2 180 deg arcs): @@ -568,7 +568,7 @@ void PLOTTER::ThickSegment( const VECTOR2I& start, const VECTOR2I& end, int widt } else { - SetCurrentLineWidth( -1 ); + SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); segmentAsOval( start, end, width, tracemode ); } } @@ -628,17 +628,17 @@ void PLOTTER::ThickRect( const VECTOR2I& p1, const VECTOR2I& p2, int width, } else { - SetCurrentLineWidth( -1 ); - VECTOR2I offsetp1( p1.x - ( width - m_currentPenWidth ) / 2, - p1.y - ( width - m_currentPenWidth ) / 2 ); - VECTOR2I offsetp2( p2.x + ( width - m_currentPenWidth ) / 2, - p2.y + ( width - m_currentPenWidth ) / 2 ); - Rect( offsetp1, offsetp2, FILL_T::NO_FILL, -1 ); - offsetp1.x += ( width - m_currentPenWidth ); - offsetp1.y += ( width - m_currentPenWidth ); - offsetp2.x -= ( width - m_currentPenWidth ); - offsetp2.y -= ( width - m_currentPenWidth ); - Rect( offsetp1, offsetp2, FILL_T::NO_FILL, -1 ); + SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); + VECTOR2I offsetp1( p1.x - ( width - GetCurrentLineWidth() ) / 2, + p1.y - ( width - GetCurrentLineWidth() ) / 2 ); + VECTOR2I offsetp2( p2.x + ( width - GetCurrentLineWidth() ) / 2, + p2.y + ( width - GetCurrentLineWidth() ) / 2 ); + Rect( offsetp1, offsetp2, FILL_T::NO_FILL, USE_DEFAULT_LINE_WIDTH ); + offsetp1.x += ( width - GetCurrentLineWidth() ); + offsetp1.y += ( width - GetCurrentLineWidth() ); + offsetp2.x -= ( width - GetCurrentLineWidth() ); + offsetp2.y -= ( width - GetCurrentLineWidth() ); + Rect( offsetp1, offsetp2, FILL_T::NO_FILL, USE_DEFAULT_LINE_WIDTH ); } } @@ -652,9 +652,9 @@ void PLOTTER::ThickCircle( const VECTOR2I& pos, int diametre, int width, OUTLINE } else { - SetCurrentLineWidth( -1 ); - Circle( pos, diametre - width + m_currentPenWidth, FILL_T::NO_FILL, -1 ); - Circle( pos, diametre + width - m_currentPenWidth, FILL_T::NO_FILL, -1 ); + SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); + Circle( pos, diametre - width + GetCurrentLineWidth(), FILL_T::NO_FILL, USE_DEFAULT_LINE_WIDTH ); + Circle( pos, diametre + width - GetCurrentLineWidth(), FILL_T::NO_FILL, USE_DEFAULT_LINE_WIDTH ); } } @@ -667,8 +667,8 @@ void PLOTTER::FilledCircle( const VECTOR2I& pos, int diametre, OUTLINE_MODE trac } else { - SetCurrentLineWidth( -1 ); - Circle( pos, diametre, FILL_T::NO_FILL, -1 ); + SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); + Circle( pos, diametre, FILL_T::NO_FILL, USE_DEFAULT_LINE_WIDTH ); } }