Skip to content

Commit c786e61

Browse files
committed
Direct2D: Fix fillAlphaChannelWithCurrentBrush when the source position is non-zero
1 parent 087f915 commit c786e61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,8 @@ void Direct2DGraphicsContext::clipToImageAlpha (const Image& sourceImage, const
12081208
// Make a transformed bitmap brush using the bitmap
12091209
// As usual, apply the current transform first *then* the transform parameter
12101210
ComSmartPtr<ID2D1BitmapBrush> brush;
1211-
auto matrix = D2DUtilities::transformToMatrix (brushTransform);
1211+
const auto pageTransform = AffineTransform::translation (pagesAndArea.area.getTopLeft()).inverted();
1212+
auto matrix = D2DUtilities::transformToMatrix (pageTransform.followedBy (brushTransform));
12121213
D2D1_BRUSH_PROPERTIES brushProps = { 1.0f, matrix };
12131214

12141215
auto bitmapBrushProps = D2D1::BitmapBrushProperties (D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE_CLAMP);

0 commit comments

Comments
 (0)