Re: [patch] middle button panning



Lars Clausen wrote:

variables for this -- the Tool already has userdata that could hold the
former tool data.

Does it ? I think it doesn't:

struct _Tool {
 ToolType type;

 /*  Action functions  */
 ButtonPressFunc    button_press_func;
 ButtonReleaseFunc  button_release_func;
 MotionFunc         motion_func;
 DoubleClickFunc    double_click_func;
};

... and using tool_select to select the new tool is not exactly right because it will free the Tool structure.

There are of course many solutions available:

- add userdata field to Tool
- introduce a new variable transient_tool (separate from active_tool), which would be mostly NULL unless middle button panning (and similar functions, triggered by Shift- Ctrl- Alt- dragging, like Ctrl-dragging clone) is in progress (best OOD-wise I think) - add former state field to ScrollTool, and cast the pointer+check userdata instead of checking is_middle_panning (breaks encapsulation => not very futureproof)

What do you think ?

Instant zoom would probably be highly useful.  That sounds like a good
combo.

I'll try to include it in the fixed patch. Of course, there are situations where it isn't a good idea (two wheel mice, one wheel for X one for Y?).

Krzysztof





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]