diff --git a/include/marker_base.h b/include/marker_base.h index da731afa24..fe64c5a742 100644 --- a/include/marker_base.h +++ b/include/marker_base.h @@ -64,6 +64,7 @@ public: * The scaling factor to convert polygonal shape coordinates to internal units. */ int MarkerScale() const { return m_scalingFactor; } + void SetMarkerScale( int aScale ) { m_scalingFactor = aScale; } /** * Return the shape polygon in internal units in a #SHAPE_LINE_CHAIN the coordinates diff --git a/pcbnew/pcb_marker.cpp b/pcbnew/pcb_marker.cpp index d0d7b4ad19..9c798e74db 100644 --- a/pcbnew/pcb_marker.cpp +++ b/pcbnew/pcb_marker.cpp @@ -40,7 +40,7 @@ /// Factor to convert the maker unit shape to internal units: -#define SCALING_FACTOR Millimeter2iu( 0.075 ) +#define SCALING_FACTOR Millimeter2iu( 0.1625 ) @@ -205,6 +205,12 @@ KIGFX::COLOR4D PCB_MARKER::getColor() const } +void PCB_MARKER::SetZoom( double aZoomFactor ) +{ + SetMarkerScale( SCALING_FACTOR * aZoomFactor ); +} + + const EDA_RECT PCB_MARKER::GetBoundingBox() const { EDA_RECT bbox = m_shapeBoundingBox; diff --git a/pcbnew/pcb_marker.h b/pcbnew/pcb_marker.h index 2373321127..1398f6f41d 100644 --- a/pcbnew/pcb_marker.h +++ b/pcbnew/pcb_marker.h @@ -97,6 +97,8 @@ public: BITMAPS GetMenuImage() const override; + void SetZoom( double aZoomFactor ); + const BOX2I ViewBBox() const override; const EDA_RECT GetBoundingBox() const override; diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 1766ab2e14..5b33ebebae 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1911,6 +1911,8 @@ void PCB_PAINTER::draw( const PCB_MARKER* aMarker, int aLayer ) return; } + const_cast( aMarker )->SetZoom( 1.0 / sqrt( m_gal->GetZoomFactor() ) ); + SHAPE_LINE_CHAIN polygon; aMarker->ShapeToPolygon( polygon );