← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Middle mouse button pan for eeschema and pcbnew drawpanel



While building kicad on windows today, I've run across an error in the
patch from the previous email. It's now fixed, and attached here.
Please use this one for testing (patches lp revno 3477).


On Sun, Mar 25, 2012 at 10:01 PM, lajos kamocsay <panka.nospam@xxxxxxxxx> wrote:
> Hi Dick-
> Attached is a patch to lp revno 3477 that has both free and scrollbar
> size limited (cookie tray) pan mode.
> To build the cookie tray version, define MB_PAN_SCROLLBAR_LIMITS with
> cmake (e.g. -DMB_PAN_SCROLLBAR_LIMITS=1).
> The free mode builds if MB_PAN_SCROLLBAR_LIMITS is not defined.
> This patch is not production ready, we should decide which mode to go
> with and remove the other, or if we want both modes, then I need to
> add a gui option for switching.
> I think there are advantages to both modes. In free mode you can pan
> outside the page (for example if reorganizing a pcb, and modules are
> moved outside temporarily), but the cookie tray mode keeps the view
> inside the page limits, which is also nice. Please let me know which
> one you prefer.
> While I was working on this, I found some bugs in EDA_DRAW_PANEL::OnScroll:
>  - when checking the end position for the scrollbar, only the
> VirtualSize was taken into account, when the end position is really
> VirtualSize-ClientSize
>  - the calculations were done in ScrollPixelsPerUnit, but at the end
> the results were again divided by ScrollPixelsPerUnit (this did not
> show up because ScrollPixelsPerUnit is forced to 1 in drawframe, but
> would not work for other values).
> I fixed those in the attached patch.
> There is also another bug that I ran into, which I didn't have time to
> fix. Basically when zooming in with any of the page borders visible,
> one of the scrollbars is not sized correctly. See the attached
> screenshot. If it's in nobody's queue, I can fix it. Please let me
> know.
> Thanks-
> -lajos
> On Sun, Mar 25, 2012 at 9:48 AM, Dick Hollenbeck <dick@xxxxxxxxxxx> wrote:
>> lajos,
>> Thanks for your continuing helpfulness.

Attachment: kicad_middle_button_pan_revno_3477.patch
Description: Binary data