Skip to content

Translate clip paths for text with RenderLocation. #399

Merged
JimBobSquarePants merged 1 commit into
mainfrom
js/fix-text-clip
May 25, 2026
Merged

Translate clip paths for text with RenderLocation. #399
JimBobSquarePants merged 1 commit into
mainfrom
js/fix-text-clip

Conversation

@JimBobSquarePants
Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fix #397

This pull request addresses a bug in how clipping paths are applied when rendering text with a positional offset, ensuring that clip paths are correctly transformed into the text's local coordinate space. It also adds comprehensive regression tests to validate the fix for various boolean clip operations and provides new reference images for test verification.

Bug Fixes:

  • Corrected the transformation of clipPaths in DrawingCanvas<TPixel>.CreateTextCompositionCommand so that when text is rendered with a non-zero RenderLocation, the clip paths are translated into the glyph-local coordinate space, ensuring correct clipping behavior. [1] [2] [3]

Testing Improvements:

  • Added a new test class Issue_397 to cover scenarios where text is drawn with intersecting and non-intersecting clipping paths using all boolean operations, validating both the fix and expected rendering output.
  • Added reference output images for all test cases in Issue_397 to support regression testing and visual verification. [1] [2] [3] [4] [5] [6] [7]

@JimBobSquarePants JimBobSquarePants added the bug Something isn't working label May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86%. Comparing base (0019fdb) to head (f006d07).

Files with missing lines Patch % Lines
...eSharp.Drawing/Processing/DrawingCanvas{TPixel}.cs 87% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@         Coverage Diff         @@
##           main   #399   +/-   ##
===================================
- Coverage    86%    86%   -1%     
===================================
  Files       109    109           
  Lines      9052   9058    +6     
  Branches   1085   1087    +2     
===================================
+ Hits       7820   7825    +5     
  Misses      982    982           
- Partials    250    251    +1     
Flag Coverage Δ
unittests 86% <87%> (-1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JimBobSquarePants JimBobSquarePants merged commit b23e2ae into main May 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant