Re: [fltk.coredev] Gesture progress for 1.4?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Gesture progress for 1.4? Rob McDonald 17:20 Oct 12 top right image
 
On Tuesday, October 12, 2021 at 3:13:23 PM UTC-7 Albrecht Schlosser wrote:
On 10/12/21 7:13 PM Rob McDonald wrote:
> https://github.com/ramcdona/fltk/tree/MacOS_Gestures

Yep, found it. The only "real" issue is in draw(): you're pushing the
matrix at the wrong place in the code. You need to move
'fl_push_matrix();' up before 'fl_translate(...);' and it should work
... with some minor issues. Cute!

That would have taken me a long time to figure out -- drawing the first time works, but I suppose it quickly out-runs the stack depth of 4 and stops working...  Thanks much for the tip - makes perfect sense. 

What I saw so far: the rotation is "inverted". I'm leaving this one up
to you (unless this was intended).

No, and the 'scroll' to pan was also inverted.

Since it wasn't working, I wasn't able to test out the sign convention -- so no surprise they were wrong.

FLTK's fl_rotate() is positive CCW whereas FL_ROTATE_GESTURE is positive CW.  The sign flip is expected.

The handling of FL_SCROLL_GESTURE had a negative inherited from the FL_MOUSEWHEEL code -- since it seemed quite counterintuitive for this use, I removed it there.

There was also one problem with event delivery (missing FL_ZOOM_GESTURE
in Fl_Group::handle(). I added it and now it works - at least as I'd expect.

Thanks 

I've updated my branch with all these fixes together.  It makes for a little 2D app that responds in all the ways I would want it to -- rotate, pan, zoom.

It looks like MacOS and Windows both also support a swype gesture -- I hadn't looked into it because I don't see a use in my application.  However, as long as we're at it, we should probably be complete.

Rob



--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/f6dec600-93e9-4d57-8db2-d39db09ec73fn%40googlegroups.com.
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.