kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #10534
Re: [PATCH] - Implement auto panning while moving in EDA_DRAW_PANEL::OnMouseEvent()
Thanks Chris for reporting this problem.
I am not thrilled about having support for panning in two different places (especially if
the original location is no longer functional). The original place is
EDA_DRAW_PANEL::OnMouseLeaving() as you pointed out.
Looking in there, I discovered an "off by one error".
Fixing that error seems to be another way to make travelling off the right or bottom edge
work better, works essentially perfectly as far as I can tell. This is without your
patch, and therefore without the 5 percent margin.
If we still want the 5 percent margin, then we probably should get rid of
OnMouseLeaving(), which is no longer needed as far as I can tell.
Let's start by you testing my patch. And then I would like your opinion on that behavior
and some other opinions.
Dick
=== modified file 'common/drawpanel.cpp'
--- common/drawpanel.cpp 2013-02-21 20:53:50 +0000
+++ common/drawpanel.cpp 2013-06-09 16:49:52 +0000
@@ -833,8 +833,8 @@
// Auto pan if mouse is leave working area:
wxSize size = GetClientSize();
- if( ( size.x < event.GetX() ) || ( size.y < event.GetY() )
- || ( event.GetX() <= 0) || ( event.GetY() <= 0 ) )
+ if( size.x <= event.GetX() || size.y <= event.GetY()
+ || event.GetX() <= 0 || event.GetY() <= 0 )
{
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED, ID_POPUP_ZOOM_CENTER );
cmd.SetEventObject( this );
Follow ups
References