-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix rendering along open paths. #263
Conversation
@@ -96,23 +95,6 @@ protected override void BeginText(in FontRectangle bounds) | |||
} | |||
|
|||
this.DrawingOperations.Clear(); | |||
|
|||
float yOffset = this.textOptions.VerticalAlignment switch |
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.
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 |
Would it be possible to get some eyes on this? |
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
DrawLines
toDrawLine
as you can only draw one line at a time using the method.