Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/core/ui/styling/background.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1130,11 +1130,12 @@ function drawBoxShadow(view: View): void {
shadowLayer.allowsEdgeAntialiasing = true;
shadowLayer.contentsScale = Screen.mainScreen.scale;

// Shadow opacity is handled on the shadow's color instance
// The color's alpha is the shadow's opacity; the color itself must be
// passed opaque, or the alpha is applied twice (0.3 renders as 0.09).
shadowLayer.shadowOpacity = boxShadow.color?.a ? boxShadow.color.a / 255 : 1;
// Use this multiplier to imitate CSS shadow blur
shadowLayer.shadowRadius = shadowRadius * 0.5;
shadowLayer.shadowColor = boxShadow.color?.ios?.CGColor;
shadowLayer.shadowColor = boxShadow.color?.ios?.colorWithAlphaComponent(1)?.CGColor;
shadowLayer.shadowOffset = CGSizeMake(offsetX, offsetY);

// Apply spread radius by expanding shadow layer bounds (this has a nice glow with radii set to 0)
Expand Down
Loading