-
Notifications
You must be signed in to change notification settings - Fork 689
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 canvas exclude method #3004
Conversation
Wow. Just wow. 🤩 |
…endicular intersection detection
Now works for perpendicular intersection too (cutting at most 1 cell out - i.e. splitting a line into 2). |
One corner case bug currently is that the resulting lines are always of positive length. Now a horizontal line x=1 with length 5 is the same as one with x=5 with length -5 But not so for the special case of length = 1 vs length = -1 when joined to another line. In this case a So I think I will need to ensure returned lines keep their +/- length. See here when cutting horizontally just above the bottom line the bottom corners flip to pointing downwards (+1 length is down on y axis) |
No it can't, otherwise you can't control the flow.
That the right behavior.
That was the problem I was facing before and I made confusion that corner could have more than one way to achieve them, but thankfully to you I learned that they must have unique values and the only exception is that no matter if vertical or horizontal are used first.
Make sure it always return the signal value.
Yes I see, but I think you can manipulate that by getting the Y position where you cutting and the corner case you are manipulating. If the desired effect is the opposite return the right ones. |
…ength lines are left
…into line-canvas-exclude
Error is tree view colors unit test. Should be good to go though. |
Fixes #_____ - Include a terse summary of the change or which issue is fixed.
This is a WIP. Current implementation only works for parallel exclusion, perpendicular exclusion and more tests will be added before I mark this ready. There may be 'off by 1' type bugs.
It is an alternative to the proposed
DrawIncompleteFrame
.Use Case:
Ability to draw rectangles (or other shapes) with parts of the boundary line snipped out e.g. for
TabView
. Also in general, to apply an 'eraser' effect to aLineCanvas
.Approach:
Adds extension method
Exclude
to collections ofStraightLine
(this decouples the method fromLineCanvas
).Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)