Skip to content
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

Refactor user interactions. Fixes #2 #9

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Refactor user interactions. Fixes #2 #9

merged 2 commits into from
Jan 24, 2024

Conversation

kflorence
Copy link
Owner

@kflorence kflorence commented Jan 23, 2024

Refactored all interactions to use pointer events instead of mouse and
touch events. Implemented pinch zooming for multi-touch enabled
devices and re-implemented pan support for pointer events.

The EventListener class has been refactored to allow defining an element
per event. It also allows defining options on initialization or when
adding events.

Events specific to Puzzle were moved out of index and into the Puzzle
class. Other miscellaneous interactions were better organized into other
files.

Modifier selection now provides haptic feedback on touch devices. The
concept of toggling a modifier has been introduced, which can allow for
the toggling of modifier state based on interaction. For example, middle
clicking on a modifier with a mouse will toggle it as will triggering a
pointer down on a modifier followed by a pointer leave. For now, this
behavior is only used to toggle the rotation direction of the rotate
modifier, but it could be used for other things in the future.

The header/footer drop-shadows now correctly always overlay the canvas
area.

Refactored all interactions to use pointer events instead of mouse and
touch events. Implemented pinch zooming for multi-touch enabled devices
and re-implemented pan support for pointer events.

This is mostly ready to go, but there is some odd behavior when pinch
zooming occasionally when your fingers get close to the edge of the
canvas (it makes the zooming stutter a little bit).
@kflorence kflorence changed the title Initial refactor of user interactions Initial refactor of user interactions. Fixes #2 Jan 23, 2024
The EventListener class has been refactored to allow defining an element
per event. It also allows defining options on initialization or when
adding events.

Events specific to Puzzle were moved out of index and into the Puzzle
class. Other miscellaneous interactions were better organized into other
files.

Modifier selection now provides haptic feedback on touch devices. The
concept of toggling a modifier has been introduced, which can allow for
the toggling of modifier state based on interaction. For example, middle
clicking on a modifier with a mouse will toggle it as will triggering a
pointer down on a modifier followed by a pointer leave. For now, this
behavior is only used to toggle the rotation direction of the rotate
modifier, but it could be used for other things in the future.

The header/footer dropshadows now correctly always overlay the canvas
area.
@kflorence kflorence changed the title Initial refactor of user interactions. Fixes #2 Refactor user interactions. Fixes #2 Jan 24, 2024
@kflorence kflorence merged commit 4e000f3 into main Jan 24, 2024
1 check passed
@kflorence kflorence deleted the 2 branch January 24, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant