Scale polygon drawing guides with zoom.

Fixes https://gitlab.com/kicad/code/kicad/issues/4769
This commit is contained in:
Jeff Young 2020-07-01 17:14:47 +01:00
parent 424d551054
commit e26625fc99
1 changed files with 2 additions and 6 deletions

View File

@ -22,16 +22,12 @@
*/ */
#include <preview_items/polygon_item.h> #include <preview_items/polygon_item.h>
#include <preview_items/preview_utils.h>
#include <gal/graphics_abstraction_layer.h>
#include <painter.h> #include <painter.h>
#include <view/view.h> #include <view/view.h>
using namespace KIGFX::PREVIEW; using namespace KIGFX::PREVIEW;
const double POLYGON_ITEM::POLY_LINE_WIDTH = 150000.0; const double POLYGON_ITEM::POLY_LINE_WIDTH = 1;
POLYGON_ITEM::POLYGON_ITEM(): POLYGON_ITEM::POLYGON_ITEM():
SIMPLE_OVERLAY_ITEM() SIMPLE_OVERLAY_ITEM()
@ -61,7 +57,7 @@ void POLYGON_ITEM::drawPreviewShape( KIGFX::VIEW* aView ) const
auto& gal = *aView->GetGAL(); auto& gal = *aView->GetGAL();
auto rs = aView->GetPainter()->GetSettings(); auto rs = aView->GetPainter()->GetSettings();
gal.SetLineWidth( POLY_LINE_WIDTH ); gal.SetLineWidth( (float) aView->ToWorld( POLY_LINE_WIDTH ) );
gal.DrawPolyline( m_lockedChain ); gal.DrawPolyline( m_lockedChain );
// draw the leader line in a different color // draw the leader line in a different color