Skip to content

Commit

Permalink
fix(ui-canvas): Canvas iOS bitmaps incorrect shadow offset-y
Browse files Browse the repository at this point in the history
  • Loading branch information
CatchABus committed Dec 13, 2024
1 parent 4305a8d commit 8e55388
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui-canvas/canvas.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,11 @@ export class Canvas implements ICanvas {

if (paint.shadowLayer) {
const s = paint.shadowLayer;
CGContextSetShadowWithColor(ctx, CGSizeMake(s.dx, s.dy), s.radius, s.color.ios.CGColor);
// Bitmaps have their coordinate system flipped vertically and that affects shadows offset
// so flip shadow offset y as well
const offsetY = this.mIsBitmap ? -s.dy : s.dy;

CGContextSetShadowWithColor(ctx, CGSizeMake(s.dx, offsetY), s.radius, s.color.ios.CGColor);
} else {
CGContextSetShadow(ctx, CGSizeZero, 0);
}
Expand Down

0 comments on commit 8e55388

Please sign in to comment.