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

UI rendering corrections and constrained angles feature #12

Merged
merged 8 commits into from
Aug 23, 2024

Conversation

mwomick
Copy link
Contributor

@mwomick mwomick commented Aug 23, 2024

Description

I added a new feature where users can hold down 'Shift' to constrain angles to 45-degree increments. This is especially helpful for some special cases where lines are often vertical or horizontal. I also fixed a lot of rendering bugs. For example, previously, the 'Clear all polygons' feature caused polygons/lines to change color upon closure. Additionally, I changed the rendering order so that shapes being drawn appear above rather than below the existing shapes. I also changed the order so that the polygon fill is not drawn over the lines, and the lines are not drawn over the nodes. Previously, the lines were drawn in the same color until a polygon was drawn and then lines would be drawn in the next color in the queue. Now each line is drawn in a new color. Previously the nodes were not drawn on the canvas until the mouse moved, but now they are drawn as soon as the user clicks. And lastly, I changed the lineJoin type to be bevel instead of miter because small angles could cause ugly sharp points that extended beyond the nodes.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

I tested this manually by using Safari and Chrome.

Any specific deployment considerations

No.

@mwomick mwomick mentioned this pull request Aug 23, 2024
2 tasks
@capjamesg capjamesg self-requested a review August 23, 2024 19:00
Copy link
Collaborator

@capjamesg capjamesg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an excellent set of changes. All looks good to me from testing. The shift feature is great to have. A potential nice to have is to document the shift key shortcut somewhere on the landing page, but it isn't necessary. I'm going to merge this PR.

@capjamesg capjamesg merged commit 9e75dad into roboflow:main Aug 23, 2024
1 check passed
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.

2 participants