Skip to content
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

Ensure the negatively offset shapes are correctly offset the ImageBrush Texture during rendering. #309

Merged
merged 4 commits into from
Dec 11, 2023

Conversation

tocsoft
Copy link
Member

@tocsoft tocsoft commented Dec 9, 2023

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

This fixes up the fill with brush pipelines to ensure that the push gets the correct region its supposed to be filling, even if they are negatively offset.

It also exposes a new ImageBrush constructor overload to allow manually offsetting the texture independent to the drawn location. This is needed by the Clip processor as the texture its working with doesn't always line-up nicely when negative offsets are applied.

resolves #308

Copy link

codecov bot commented Dec 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3fb38a4) 80% compared to head (184fe2e) 80%.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #309   +/-   ##
===================================
  Coverage    80%    80%           
===================================
  Files        97     97           
  Lines      4946   4960   +14     
  Branches    884    886    +2     
===================================
+ Hits       3997   4011   +14     
  Misses      754    754           
  Partials    195    195           
Flag Coverage Δ
unittests 80% <100%> (+<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.

/// The region of interest.
/// This overrides any region used to initialize the brush applicator.
/// </param>
internal ImageBrush(Image image, RectangleF region)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the constructor internal again. Was that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, I had failed to update my working branch when I started the PR. Fixed.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!! 👏

@JimBobSquarePants JimBobSquarePants merged commit fda6302 into main Dec 11, 2023
9 checks passed
@tocsoft tocsoft deleted the sw/image-brush-offsets branch December 11, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageBrush incorrectly offset when target region (Path or Rectangle) has a negative offset.
2 participants