akiraux / akiraux/libgtkcanvas

Add angle-snapping when rotating

Open
#22 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
47
Forks
4
PR merge metrics
No merged PRs in 30d

Description

I've implemented that like this:

If the object is rotated, by dragging the node, by a `rotation` amount (in degrees, for this example), then the actual rotation would be equal to:

rotation - rotation % 15

For example, if the input rotation is _67°_, then the applied rotation would be _67 - 67 % 15 = 67 - 7 = 60_.

And that works fine. However, this isn't the default behavior in 99% of the software I've used, but rather, it's freehand rotation, until you press a key (most likely `Ctrl`), and then the snapping is applied. And currently I don't know how to detect whether `Ctrl` is pressed or not, so I can't finish this feature on my own (if I figure it out, I will send in a PR).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.