diff --git a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp index 9d3e10d0ba..5a73c3f3e9 100644 --- a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp @@ -347,32 +347,32 @@ public: Point translation{}; AffineTransform transform{}; - if ((flags & BrushTransformFlags::applyWorldTransform) != 0) - { - if (currentTransform.isOnlyTranslated) - translation = currentTransform.offset.toFloat(); - else - transform = currentTransform.getTransform(); - } - - if ((flags & BrushTransformFlags::applyFillTypeTransform) != 0) - { - if (fillType.transform.isOnlyTranslation()) - translation += Point (fillType.transform.getTranslationX(), fillType.transform.getTranslationY()); - else - transform = transform.followedBy (fillType.transform); - } - - if ((flags & BrushTransformFlags::applyInverseWorldTransform) != 0) - { - if (currentTransform.isOnlyTranslated) - translation -= currentTransform.offset.toFloat(); - else - transform = transform.followedBy (currentTransform.getTransform().inverted()); - } - if (fillType.isGradient()) { + if ((flags & BrushTransformFlags::applyWorldTransform) != 0) + { + if (currentTransform.isOnlyTranslated) + translation = currentTransform.offset.toFloat(); + else + transform = currentTransform.getTransform(); + } + + if ((flags & BrushTransformFlags::applyFillTypeTransform) != 0) + { + if (fillType.transform.isOnlyTranslation()) + translation += Point (fillType.transform.getTranslationX(), fillType.transform.getTranslationY()); + else + transform = transform.followedBy (fillType.transform); + } + + if ((flags & BrushTransformFlags::applyInverseWorldTransform) != 0) + { + if (currentTransform.isOnlyTranslated) + translation -= currentTransform.offset.toFloat(); + else + transform = transform.followedBy (currentTransform.getTransform().inverted()); + } + const auto p1 = fillType.gradient->point1 + translation; const auto p2 = fillType.gradient->point2 + translation; @@ -389,6 +389,17 @@ public: linearGradient->SetEndPoint ({ p2.x, p2.y }); } } + else if (fillType.isTiledImage()) + { + if ((flags & BrushTransformFlags::applyWorldTransform) != 0) + transform = currentTransform.getTransform(); + + if ((flags & BrushTransformFlags::applyFillTypeTransform) != 0) + transform = transform.followedBy (fillType.transform); + + if ((flags & BrushTransformFlags::applyInverseWorldTransform) != 0) + transform = transform.followedBy (currentTransform.getTransform().inverted()); + } currentBrush->SetTransform (D2DUtilities::transformToMatrix (transform)); currentBrush->SetOpacity (fillType.getOpacity());