Skip to content

Commit

Permalink
change dash formula precision
Browse files Browse the repository at this point in the history
dashes are not showing evenly spaced in some scenarios.
<img width="1920" alt="uneven-dashes" src="https://github.com/user-attachments/assets/e814ace7-3e16-4b3f-b474-29fe87683a54">

This is due to the default precision we use for Wang's formula.
ended up changing the precision only for dashes because from my tests, follow path and trim path didn't make a big difference.

Diffs=
35734d2d5 change dash formula precision (#8219)

Co-authored-by: hernan <[email protected]>
  • Loading branch information
bodymovin and bodymovin committed Sep 25, 2024
1 parent a554bd9 commit 0fd6546
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
be2c46a3e79447b4fc510badbba5755075edba27
35734d2d546e5a7a5a6eb015a4f6e75e97fafbb0
3 changes: 2 additions & 1 deletion src/shapes/paint/dash_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ RenderPath* PathDasher::dash(const RawPath& source,
m_rawPath.rewind();
if (m_contours.empty())
{
ContourMeasureIter iter(&source);
// 0.5f / 8.0f is a value that seems to look good on dashes with small gaps and scaled
ContourMeasureIter iter(&source, 0.0625f);
while (auto meas = iter.next())
{
m_contours.push_back(meas);
Expand Down

0 comments on commit 0fd6546

Please sign in to comment.