-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1. support long press like flutter #23
base: master
Are you sure you want to change the base?
Conversation
Null safety, thanks to @IsmailAlamKhan
-several core fixes for null-safety. -fixed the non-working examples. -added some comments in the README. -increased the version.
Migrated the examples to null-safety
- fixes an error in `Graphics.drawPoly()`.
First of all, thanks for the PR! Regarding the longPress signal, it would be great to be able to configure the threshold distance and duration, on demand, how do think that should look like? |
@roipeker Yes, we need configurable the duration and test distance. Maybe configure them on displayobject or others ? |
Might be. Although Im still unsure about the addition on DisplayObject for this "compound" gesture... as you might as well create a mixin, or extension to add this behavior on top of the current input signals for your specific objects. Too bad that we should stay "idiomatic" with the Signal callbacks, otherwise something like |
@roipeker yes, I am also think |
d4da0a4
to
29026f6
Compare
29026f6
to
348a86b
Compare
Hello, I am already finished it. |
And more, I will start to multi-touch event next, did you have any ideas? |
No idea in particular to be honest. Might start from stage for the basics events: down, move, release for each touch id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check the comments and give me your thoughts
lib/src/events/signal.dart
Outdated
EventSignal(); | ||
factory EventSignal.longPress(Duration duration,double distance) { | ||
var signal = EventSignal<T>(); | ||
signal.configure[EventSignalConfKey.LongPressDuration] = duration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another observation, even if the Duration type makes total sense in Dart/Flutter, GraphX is currently using double to express durations in the tween system and the "ticker" elapsed time since last frame ... ( 0.1 = 100 milliseconds). Just a thought, as that concept is taken from JS/AS3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Duration is better on user side, maybe we can translate Duration to double ticks?
…-support # Conflicts: # CHANGELOG.md # README.md # example/lib/demos/simple_interactions/ui/my_button.dart # example/pubspec.yaml # example/readme.md # lib/src/display/display_object.dart # lib/src/events/mixins.dart # lib/src/render/graphics.dart # lib/src/tween/src/mixins/tweenable.dart # pubspec.lock # pubspec.yaml
What's this PR doing ?
#1. added new mouse event callback on DisplayObject called
onLongPress
.how the new event
longPress
happed ?