mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): Shadow layer origin point update (#10376)
This commit is contained in:
committed by
GitHub
parent
39eed526c1
commit
f54ebbb2bf
@@ -1125,9 +1125,12 @@ function drawBoxShadow(view: View): void {
|
||||
}
|
||||
}
|
||||
|
||||
// Since shadow layer is added to view layer's superlayer, we have to be more specific about shadow layer position
|
||||
outerShadowContainerLayer.bounds = bounds;
|
||||
outerShadowContainerLayer.position = CGPointMake(viewFrame.origin.x + viewFrame.size.width / 2, viewFrame.origin.y + viewFrame.size.height / 2);
|
||||
outerShadowContainerLayer.anchorPoint = layer.anchorPoint;
|
||||
|
||||
// Since shadow uses superlayer's coordinate system, we have to be more specific about shadow layer position
|
||||
const { x: originX, y: originY }: CGPoint = outerShadowContainerLayer.anchorPoint;
|
||||
outerShadowContainerLayer.position = CGPointMake(viewFrame.origin.x + viewFrame.size.width * originX, viewFrame.origin.y + viewFrame.size.height * originY);
|
||||
|
||||
// Inherit view visibility values
|
||||
outerShadowContainerLayer.opacity = layer.opacity;
|
||||
|
||||
Reference in New Issue
Block a user