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

Direct2D: Fix image artefacts at the edge of alpha-clipped regions

This addresses the same issue that
95d416ab77 was intended to fix:

Drawing a drop shadow on a high-res display on Windows could sometimes
produce thin lines around the edge of the shadow. Using the 'clamp'
rather than the 'wrap' clipping mode seems to help.
This commit is contained in:
reuk 2025-02-08 16:12:30 +00:00
parent 5aa76a7d7e
commit 92c7d73d2d
No known key found for this signature in database

View file

@ -1211,7 +1211,7 @@ void Direct2DGraphicsContext::clipToImageAlpha (const Image& sourceImage, const
auto matrix = D2DUtilities::transformToMatrix (brushTransform);
D2D1_BRUSH_PROPERTIES brushProps = { 1.0f, matrix };
auto bitmapBrushProps = D2D1::BitmapBrushProperties (D2D1_EXTEND_MODE_WRAP, D2D1_EXTEND_MODE_WRAP);
auto bitmapBrushProps = D2D1::BitmapBrushProperties (D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE_CLAMP);
auto hr = deviceContext->CreateBitmapBrush (bitmap, bitmapBrushProps, brushProps, brush.resetAndGetPointerAddress());
if (FAILED (hr))