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
Dot grid #1709
Dot grid #1709
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.
Thanks for your effort so far.
editor/src/messages/portfolio/document/overlays/grid_overlays.rs
Outdated
Show resolved
Hide resolved
Thank you for the input. I will be taking a break from this PR for the next few days while I work on my GSoC proposal. Once that's done I'll continue working on it |
I believe all changes should have been made. I removed the Dot grid type, and instead added a Boolean field that tracks whether the grid should be displayed with dots. This also makes it easy to add a dot grid for the Isometric type, if there are plans for that. Just remove the condition for displaying the checkbox, create the display function, and use it accordingly. I removed the prefixed color methods and used concatenation and remove_prefix accordingly. Currently this PR is blocked by the Color bug, since it starts at |
!build |
|
Performance is very poor for the dot grid. I suppose this is because x_count+y_count lines need to drawn for the rectangle grid, but x_count*y_count circles need to be drawn for the dot grid. Additionally, the .arc call to draw circles is pretty slow. I think the best way to fix this would be to replace the lines with dashed lines, but then the dots will be rectangular. Another method could be to only redraw the circles when the viewport is resized or the color is changed. |
Square 1px pixel grid aligned (no antialiasing) dots would already be the desired appearance. Just be aware that a dotted line might drift if the ratio is a non-integer fraction between the document space and viewport space, so some cleverness might be required to enable the avoidance of antialiasing by staying perfectly grid aligned. Maybe several lines per row/column with different screenspace pixel spacing intervals as the error accumulates between the non-integer fraction ratio and the ratio you need to maintain screenspace grid alignment. |
I'm putting this back to draft status till you have time again to deal with the performance suggestions in my previous comment. But don't focus on this till your other PR is done, since that's the much higher priority feature. Thanks :) |
7bf7f92
to
5f4960d
Compare
!build |
|
Superseded by #1743. This PR wasn't actually merged into master.
Closes #1704
Adds a dot type grid option. Snapping and spacing is the same as the rectangular grid.
Changes:
grid_overlay_dot
function to draw circles using the overlay contextGridType::Dot
with similar implementation toGridType::Rectangle