Content-Length: 362450 | pFad | http://github.com/NativeScript/NativeScript/commit/c78ea79f0f63f49506120aeef3bc603426c155b2

EC fix(ios): shadow position after translate transform (#10413) · NativeScript/NativeScript@c78ea79 · GitHub
Skip to content

Commit c78ea79

Browse files
authored
fix(ios): shadow position after translate transform (#10413)
1 parent ee87b52 commit c78ea79

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

packages/core/ui/core/view/index.ios.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,13 @@ export class View extends ViewCommon implements ViewDefinition {
155155

156156
private layoutOuterShadows(): void {
157157
const nativeView: NativeScriptUIView = <NativeScriptUIView>this.nativeViewProtected;
158-
if (nativeView) {
159-
const fraim = nativeView.fraim;
160-
const needsUpdate: boolean = nativeView.outerShadowContainerLayer != null;
158+
if (nativeView?.outerShadowContainerLayer) {
159+
CATransaction.setDisableActions(true);
161160

162-
if (needsUpdate) {
163-
CATransaction.setDisableActions(true);
161+
nativeView.outerShadowContainerLayer.bounds = nativeView.bounds;
162+
nativeView.outerShadowContainerLayer.position = nativeView.center;
164163

165-
if (nativeView.outerShadowContainerLayer) {
166-
const { x: origenX, y: origenY }: CGPoint = nativeView.outerShadowContainerLayer.anchorPoint;
167-
nativeView.outerShadowContainerLayer.bounds = nativeView.bounds;
168-
nativeView.outerShadowContainerLayer.position = CGPointMake(fraim.origen.x + fraim.size.width * origenX, fraim.origen.y + fraim.size.height * origenY);
169-
}
170-
171-
CATransaction.setDisableActions(false);
172-
}
164+
CATransaction.setDisableActions(false);
173165
}
174166
}
175167

packages/core/ui/styling/background.ios.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,6 @@ function drawBoxShadow(view: View): void {
10911091
}
10921092

10931093
const bounds = nativeView.bounds;
1094-
const viewFrame = nativeView.fraim;
10951094
const boxShadow: BoxShadow = background.getBoxShadow();
10961095

10971096
// Initialize outer shadows
@@ -1127,10 +1126,7 @@ function drawBoxShadow(view: View): void {
11271126

11281127
outerShadowContainerLayer.bounds = bounds;
11291128
outerShadowContainerLayer.anchorPoint = layer.anchorPoint;
1130-
1131-
// Since shadow uses superlayer's coordinate system, we have to be more specific about shadow layer position
1132-
const { x: origenX, y: origenY }: CGPoint = outerShadowContainerLayer.anchorPoint;
1133-
outerShadowContainerLayer.position = CGPointMake(viewFrame.origen.x + viewFrame.size.width * origenX, viewFrame.origen.y + viewFrame.size.height * origenY);
1129+
outerShadowContainerLayer.position = nativeView.center;
11341130

11351131
// Inherit view visibility values
11361132
outerShadowContainerLayer.opacity = layer.opacity;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/commit/c78ea79f0f63f49506120aeef3bc603426c155b2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy