← Back to team overview

kicad-developers team mailing list archive

Cursor position improvements.


While trekking though the Kicad source to removed the old zooming code, I
discovered another issue that is going to drive me insane (it's a short drive)
until it gets fixed.  Currently, there are two cursor positions stored in
Kicad.  One is the operating system cursor position and the other is the drawn
cursor position on grid (sometimes).  Both positions are in drawing units.  I
believe this causes some of the bipolar cursor behavior that you occasionally
see in Kicad.  The reason these positions are stored is because the cursor
position is not passed to any of the drawing code.  I did a little testing and
I think both of these positions can be removed.  Here is what I am proposing:

1) Modify all code paths (captured mouse callbacks, mouse clicks, etc.) that
use the current cursor (not the Kicad drawn cursor) to accept this position in
drawing units.

2) Allow the drawing code determine when to snap to grid based on the
application grid snap setting.

3) Use wxWarpPointer to provide snapping to grid on Linux and Windows.  It
turns out that calling wxWarpPointer immediately posts a wxMouseMouse event to
the new position which should allow you to use the normal refreshing code when
zooming in and out.

4) Use the stock cross hair cursor instead of drawing a separate cursor giving
you more consistent behavior between OSX and the platforms that support

Does anyone know of any reason this can't be done.  If it works properly, it
should greatly simplify the drawing code.  If no one objects, I would like to
tackle this before resuming my EESchema refactoring work.


Follow ups