Fix rendering along open paths.#263
Merged
JimBobSquarePants merged 5 commits intomainfrom Apr 4, 2023
Merged
Conversation
|
|
||
| this.DrawingOperations.Clear(); | ||
|
|
||
| float yOffset = this.textOptions.VerticalAlignment switch |
Member
Author
There was a problem hiding this comment.
Turns out we didn't actually need any of this and it was actually causing output to be rendered offset to where it should be.
Codecov Report
@@ Coverage Diff @@
## main #263 +/- ##
===================================
Coverage 61% 61%
===================================
Files 100 100
Lines 6449 6427 -22
Branches 1378 1374 -4
===================================
- Hits 3934 3923 -11
+ Misses 2314 2308 -6
+ Partials 201 196 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Member
Author
|
Would it be possible to get some eyes on this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
Fixes #234
The issue is caused by our code which calculates the position of a point along the given path at a given distance. The code works well for closed paths since it reduces the distance to the remainder (
distance %= path.Length) which makes a nice loop.For open paths we don't want to do that, we want to create a new virtual point at the correct angle and distance calculated from the last two points in the path.
I've also renamed
DrawLinestoDrawLineas you can only draw one line at a time using the method.