1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Direct2D: Update assertion to check for alignment against screen rather than current transform

This assertion is intended to mirror the behaviour of an
informational/performance diagnostic message raised by the D2D debugging
layer.

It seems the D2D diagnostic is raised when the proposed clip region is
aligned to the screen, not to the current transform.

Before this change, the assertion could incorrectly fire when clipping
to transformed rectangles. This could be seen when clicking the
star-shaped buttons in the ComponentTransformsDemo.

With this change in place, the assertion will still fire when e.g.
calling Graphics::reduceClipRegion on a screen-aligned rectangular path,
but will not fire when this path is skewed/rotated etc.
This commit is contained in:
reuk 2024-05-30 20:41:30 +01:00
parent 4122427748
commit 2a264390e8
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -55,7 +55,7 @@ public:
void push (ComSmartPtr<ID2D1DeviceContext1> context, const D2D1_LAYER_PARAMETERS& layerParameters)
{
// Clipping and transparency are all handled by pushing Direct2D
// layers.The SavedState creates an internal stack of Layer objects to
// layers. The SavedState creates an internal stack of Layer objects to
// keep track of how many layers need to be popped. Pass nullptr for
// the PushLayer layer parameter to allow Direct2D to manage the layers
// (Windows 8 or later)
@ -105,7 +105,7 @@ public:
Sink sink;
geometry->Simplify (D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
D2D1::Matrix3x2F::Identity(),
layerParameters.maskTransform,
1.0f,
&sink);