← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] - Implement auto panning while moving in EDA_DRAW_PANEL::OnMouseEvent()

 

> The if() test should probably be:
> 
> 
> if( size.x <= event.GetX() || size.y <= event.GetY()
>      || event.GetX() < 0  || event.GetY() < 0 )


Fine, that works.

But let's remember that there are workspace limits defined by how many nanometers can fit
in a 32 bit integer workspace.

I don't think any of our solutions yet are optimal.

The mouse during the drag, can be in any of 4 corners of the block, no?

If the mouse is in lower right corner, and you drag the block up and to the left, there
are two problems:

a) you don't get a pan until the block is off client (and so is the mouse).

b) it is possible to position this block off workspace, such that you can no longer show
either the board nor the block if moved up and up and left and left to the extreme end of
mouse travel.  Since the mouse travel is used in workspace limit calculation, and not the
objects in the block, then the block ends up being positioned off the workspace, I guess
at a large negative number, less than -MAX_INT


There are going to be 4 variations on problem b), for the four corners of the block.

So a comprehensive solution is going to take more time.  We've got to always keep objects
in the allowed workspace coordinate system.  So panning needs more work.   At the place
where we ask the mouse to be centered, we do end of travel limit detection and enforce
limits.  In that same place, while dragging a block we have to use the appropriate block
corner instead of the the mouse position.


Dick









Follow ups

References