-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
PencilBrush SHIFT/straight line functionality #7034
Conversation
src/brushes/pencil_brush.class.js
Outdated
@@ -246,7 +296,7 @@ | |||
var zoom = this.canvas.getZoom(), adjustedDistance = Math.pow(distance / zoom, 2), | |||
i, l = points.length - 1, lastPoint = points[0], newPoints = [lastPoint], | |||
cDistance; | |||
for (i = 1; i < l; i++) { | |||
for (i = 1; i <= l; i++) { |
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.
Needs to be validated against #6966
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.
It is why there's a merge conflict
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.
so master is at < l -1 to fix a tail issue with decimate.
Why did you add the equal in?
If you explain we can solve the conflict.
But to me is not clear why this has changed.
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 logic of straight line pops the last point and push the last pointer.
When mouse up fires and drawStraightLine=true
it decimated the end and removes the last straight line part.
I don't know/understand what decimate does so I don't want to propose anything but this can be mitigated by pushing another point on mouse up if drawStraightLine=true
(I don't like it though)
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 issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
this should be merged |
@asturur please re open and merge |
Sorry this PR was good after my conflict resolve, eventually waiting for tests to pass i forgot about it. |
This PR adds the ability to draw a straight line when pressing the
shift
key or when settingdrawStraightLine
totrue
.Logic
When
drawStraightLine = true
the brush simply pops the last point and adds the new oneLive Example