@@ -169,8 +169,9 @@ export class View extends ViewCommon implements ViewDefinition {
169
169
CATransaction . setDisableActions ( true ) ;
170
170
171
171
if ( nativeView . outerShadowContainerLayer ) {
172
+ const { x : originX , y : originY } : CGPoint = nativeView . outerShadowContainerLayer . anchorPoint ;
172
173
nativeView . outerShadowContainerLayer . bounds = nativeView . bounds ;
173
- nativeView . outerShadowContainerLayer . position = CGPointMake ( frame . origin . x + frame . size . width / 2 , frame . origin . y + frame . size . height / 2 ) ;
174
+ nativeView . outerShadowContainerLayer . position = CGPointMake ( frame . origin . x + frame . size . width * originX , frame . origin . y + frame . size . height * originY ) ;
174
175
}
175
176
176
177
CATransaction . setDisableActions ( false ) ;
@@ -450,11 +451,27 @@ export class View extends ViewCommon implements ViewDefinition {
450
451
}
451
452
452
453
public updateOriginPoint ( originX : number , originY : number ) {
454
+ const nativeView : NativeScriptUIView = < NativeScriptUIView > this . nativeViewProtected ;
453
455
const newPoint = CGPointMake ( originX , originY ) ;
454
- this . nativeViewProtected . layer . anchorPoint = newPoint ;
456
+
457
+ // Disable CALayer animatable property changes
458
+ CATransaction . setDisableActions ( true ) ;
459
+
460
+ nativeView . layer . anchorPoint = newPoint ;
455
461
if ( this . _cachedFrame ) {
456
- this . _setNativeViewFrame ( this . nativeViewProtected , this . _cachedFrame ) ;
462
+ this . _setNativeViewFrame ( nativeView , this . _cachedFrame ) ;
463
+ }
464
+
465
+ // Make sure new origin also applies to outer shadow layers
466
+ if ( nativeView . outerShadowContainerLayer ) {
467
+ // This is the new frame after view origin point update
468
+ const frame = nativeView . frame ;
469
+
470
+ nativeView . outerShadowContainerLayer . anchorPoint = newPoint ;
471
+ nativeView . outerShadowContainerLayer . position = CGPointMake ( frame . origin . x + frame . size . width * originX , frame . origin . y + frame . size . height * originY ) ;
457
472
}
473
+
474
+ CATransaction . setDisableActions ( false ) ;
458
475
}
459
476
460
477
// By default we update the view's presentation layer when setting backgroundColor and opacity properties.
0 commit comments