Add additional LineStyles#2533
Conversation
|
I added a few Unit Tests dealing with thick and thin combinations, but I'll make more for the dashed and dotted variations. |
|
This is fantastic! Note that I'm knees deep in a massive refactoring of related border LineCanvas stuff right now that will greatly benefit from your work. However, this also means I'm going to hold off reviewing and merging this pr until I'm done. If you want, you can retarget this pr to be a pr to my pr (#2527) which may streamline things. |
tig
left a comment
There was a problem hiding this comment.
Looking great. Big add.
See the bugs I think I found in my comments.
|
Same as #2542 (comment). The |
|
here's the fix: var borderBounds = new Rect (
screenBounds.X + Math.Max (0, Thickness.Left - 1),
screenBounds.Y + Math.Max (0, Thickness.Top - 1),
screenBounds.Width - (Math.Max (0, Math.Max (0, Thickness.Left - 1) + Math.Max (0, Thickness.Right - 1))),
screenBounds.Height - (Math.Max (0, Math.Max (0, Thickness.Top - 1) + Math.Max (0, Thickness.Bottom - 1)))); |
Thanks @tig. That throws exceptions if dimensions are negative. This is more accurate: var borderBounds = new Rect (
screenBounds.X + Math.Max (0, Thickness.Left - 1),
screenBounds.Y + Math.Max (0, Thickness.Top - 1),
Math.Max (0, screenBounds.Width - Math.Max (0, Math.Max (0, Thickness.Left - 1) + Math.Max (0, Thickness.Right - 1))),
Math.Max (0, screenBounds.Height - Math.Max (0, Math.Max (0, Thickness.Top - 1) + Math.Max (0, Thickness.Bottom - 1)))); |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks. Reminder: all this is temporary. My dream is all these border/title things are eventually done via subviews of the Frame. |
(less confusion with "Thickness") Also: * Add a few more runes for potential future use * Fix Unit Tests
…nto tznind-fix-line-drawing
|
@Nutzzz in case you didn't see this has merge conflicts. |


Added dashed, dotted, and thick line styles and combinations where available.
Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)