-
Notifications
You must be signed in to change notification settings - Fork 785
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
Line Retool #682
Line Retool #682
Conversation
Thanks for the PR! Quickly tested and it's indeed much faster. As you said there are still a few weird artifacts, and endings should really be square. Reading your comment I'm not sure if it was a deliberate choice, or if you could not find a way to achieve square endings? |
@@ -97,8 +97,35 @@ | |||
linePixels = pskl.PixelUtils.getLinePixels(col, this.startCol, row, this.startRow); | |||
} | |||
|
|||
pskl.PixelUtils.resizePixels(linePixels, penSize).forEach(function (point) { |
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.
Here, I exchange the square-style resize for a cross-shape resize in lines 124-129.
@@ -97,8 +97,35 @@ | |||
linePixels = pskl.PixelUtils.getLinePixels(col, this.startCol, row, this.startRow); | |||
} | |||
|
|||
pskl.PixelUtils.resizePixels(linePixels, penSize).forEach(function (point) { | |||
targetFrame.setPixel(point[0], point[1], color); |
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.
Below, I implement a (potentially verbose) procedural diamond at each end of the line. It is accomplished by conditionally coloring a square on the basis of the taxicab distance from the center of a square.
The new version works really well! Thanks a lot for updating this.
Your explanations were great, keep doing that!
Trying your precedent version, when using an even pen size (8px, 12px, 16px etc...) and drawing a line at 45degrees, you can see the "inner" part of the line is visibly 1 pixel thinner than the edges. FYI you can hold shift while using the line pen to stick to precise orientations. The new version is not affected by a similar issue, so all good! |
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.
That's a great fix, thanks @smiegrin !
If you want to add some of your comments in the source directly, feel free to do so. Otherwise I can merge as is :)
Oooh, comments seem like a good idea. Thanks for the feedback! I'll have those in just a few minutes. |
Merging! Thanks again for doing this. The implementation is really clever and it's a pleasure to read :) |
This is the last tool (as far as I'm aware) that needed a tune-up after adding larger sizes for drawing tools, and it was a bit of a bugger. Lines still aren't very uniform at varying angles, and the ends of the lines aren't square with how I set this one up. If there's anything that would be useful for the end user that's missing in this one, please don't hesitate to let me know, and I'll crack on it!