Skip to content

Commit 2f2ce54

Browse files
committed
Fix shadow issue
1 parent 2605c14 commit 2f2ce54

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/Utility/StackShadow.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,13 @@ void StackShadow::drawShadowForPath(Graphics& g, hash32 id, Path const& path, in
305305
int logicalW = roundToInt(bounds.getWidth());
306306
int logicalH = roundToInt(bounds.getHeight());
307307

308-
auto img = generateBaseShadowImage(path, radius, logicalW + radius, logicalH + radius, pixelScale);
308+
Path offsetPath = path;
309+
offsetPath.applyTransform(AffineTransform::translation(-radius, -radius));
310+
311+
auto img = generateBaseShadowImage(offsetPath, radius, logicalW + radius, logicalH + radius, pixelScale);
309312
g.saveState();
310313
g.setColour(colour);
311-
g.drawImageTransformed(img, AffineTransform::translation(horizontalOffset * pixelScale, verticalOffset * pixelScale).scaled(1.0f / pixelScale), true);
314+
g.drawImageTransformed(img, AffineTransform::translation((radius + horizontalOffset) * pixelScale, (radius + verticalOffset) * pixelScale).scaled(1.0f / pixelScale), true);
312315
g.restoreState();
313316
return;
314317
}

0 commit comments

Comments
 (0)