kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37579
Re: GAL canvas strategy - testers needed!
One more patch to fix off grid component placement after paste
operation. Apart from that, the result is very impressive. Well done!
Cheers,
Orson
On 9/19/18 11:16 PM, Jeff Young wrote:
> A couple of more commits are up (including backing out the polyline change).
>From bbd0912ff57618884b915719ce895907159ffc53 Mon Sep 17 00:00:00 2001
From: Maciej Suminski <maciej.suminski@xxxxxxx>
Date: Sat, 22 Sep 2018 17:25:37 +0200
Subject: [PATCH] Fix off-grid block paste
Center point of a block may not always be located on a grid point,
therefore it needs to be rounded to the grid size to prevent off grid
component placement.
---
eeschema/sch_base_frame.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp
index 589e0a60c..d897c2589 100644
--- a/eeschema/sch_base_frame.cpp
+++ b/eeschema/sch_base_frame.cpp
@@ -540,7 +540,8 @@ bool SCH_BASE_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a
InitBlockPasteInfos();
KIGFX::PREVIEW::SELECTION_AREA* sel = GetCanvas()->GetView()->GetSelectionArea();
- VECTOR2I offsetToCenter = ( sel->GetOrigin() - sel->GetEnd() ) / 2;
+ VECTOR2I offsetToCenter = GetCanvas()->GetGAL()->GetGridPoint(
+ ( sel->GetOrigin() - sel->GetEnd() ) / 2 );
block->SetLastCursorPosition( wxPoint( offsetToCenter.x, offsetToCenter.y ) );
if( block->GetCount() == 0 ) // No data to paste
--
2.18.0
Follow ups
References
-
Re: GAL canvas strategy
From: Jeff Young, 2018-09-03
-
Re: GAL canvas strategy - testers needed!
From: Tomasz Wlostowski, 2018-09-06
-
Re: GAL canvas strategy - testers needed!
From: mdoesbur, 2018-09-16
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-16
-
Re: GAL canvas strategy - testers needed!
From: jp charras, 2018-09-16
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-16
-
Re: GAL canvas strategy - testers needed!
From: jp charras, 2018-09-17
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-17
-
Re: GAL canvas strategy - testers needed!
From: mdoesbur, 2018-09-17
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-17
-
Re: GAL canvas strategy - testers needed!
From: Wayne Stambaugh, 2018-09-17
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-17
-
Re: GAL canvas strategy - testers needed!
From: John Beard, 2018-09-18
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-18
-
Re: GAL canvas strategy - testers needed!
From: Rene Pöschl, 2018-09-19
-
Re: GAL canvas strategy - testers needed!
From: jp charras, 2018-09-19
-
Re: GAL canvas strategy - testers needed!
From: Rene Pöschl, 2018-09-19
-
Re: GAL canvas strategy - testers needed!
From: jp charras, 2018-09-19
-
Re: GAL canvas strategy - testers needed!
From: Jeff Young, 2018-09-19