Skip to content

Commit 8e55388

Browse files
committed
fix(ui-canvas): Canvas iOS bitmaps incorrect shadow offset-y
1 parent 4305a8d commit 8e55388

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ui-canvas/canvas.ios.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,11 @@ export class Canvas implements ICanvas {
18131813

18141814
if (paint.shadowLayer) {
18151815
const s = paint.shadowLayer;
1816-
CGContextSetShadowWithColor(ctx, CGSizeMake(s.dx, s.dy), s.radius, s.color.ios.CGColor);
1816+
// Bitmaps have their coordinate system flipped vertically and that affects shadows offset
1817+
// so flip shadow offset y as well
1818+
const offsetY = this.mIsBitmap ? -s.dy : s.dy;
1819+
1820+
CGContextSetShadowWithColor(ctx, CGSizeMake(s.dx, offsetY), s.radius, s.color.ios.CGColor);
18171821
} else {
18181822
CGContextSetShadow(ctx, CGSizeZero, 0);
18191823
}

0 commit comments

Comments
 (0)