-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Guidelines Feature in Akira #669
base: main
Are you sure you want to change the base?
Conversation
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.
This looks very good, thank you so much.
Upon using it, there's are some bugs that should be fixed, and some basic features that should be changed.
Here's the list of things I discovered, in no particular order.
Bugs
- Create an Artboard, move it around, delete it. It seems that some guides are created around the edges of the artboard and they remain visible.
- Guides are not deleted when an artboard is delete, but they should.
- When an artboard with guides is moved, the guides don't move with it, but they should as guides should be anchored to the top/left corner of an artboard.
- Guides disappear and appear inside and outside the artboard when the artboard is moved around.
Features
- A guide should be deleted only when the user releases the mouse click after moving it to the edge. If I move a guide to the edge, but keep my mouse clicked, I expect to be able to move it back into the artboard since I didn't let go.
- Guides should be usable also in the entire canvas, not just limited to artboards. Canvas guides and artboard guides shouldn't interfere with each other.
Let me know what you think.
Great work!
Haven't figured out how to do this yet. Will work on it in the next PR. Let me know if there are any other changes. |
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.
The architecture here seems not ideal, but I think it's fixable. Mainly the issue I have is storing some guidelinemodels in the instance and other in the manager. I think the ModelInstance should have the minimal amount of data needed to generate guidelines, and then the guidelinemanager would generate those based on instances.
I think that if we want this, we should start with guidelines ONLY in the canvas for the time being and try to get that right.
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.
These are the changes made in the latest commit.
P.S. The guides don't work very well if the artboard is rotated. I don't think artboard are allowed to be rotated .So I haven't handled that case. |
Summary / How this PR fixes the problem?
This PR will allow the user to draw guidelines.
Guidelines are simple horizontal or vertical lines that go from edge to edge on the canvas. They are mostly used in Image To HTML conversion for responsive design.
After this PR is done, you will be able to
Q
andW
keys.Steps to Test
Q
for Horizontal andW
for vertical guidelines. The guideline will be drawn at the current cursor position.Screenshots
Known Issues / Things To Do
Some future work in next pr
Alt + 2
,Alt + 3
, etc to get distance of guideline from its 2nd, 3rd closest neighbors.