@@ -169,8 +169,9 @@ export class View extends ViewCommon implements ViewDefinition {
169169 CATransaction . setDisableActions ( true ) ;
170170
171171 if ( nativeView . outerShadowContainerLayer ) {
172+ const { x : originX , y : originY } : CGPoint = nativeView . outerShadowContainerLayer . anchorPoint ;
172173 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 ) ;
174175 }
175176
176177 CATransaction . setDisableActions ( false ) ;
@@ -450,11 +451,27 @@ export class View extends ViewCommon implements ViewDefinition {
450451 }
451452
452453 public updateOriginPoint ( originX : number , originY : number ) {
454+ const nativeView : NativeScriptUIView = < NativeScriptUIView > this . nativeViewProtected ;
453455 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 ;
455461 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 ) ;
457472 }
473+
474+ CATransaction . setDisableActions ( false ) ;
458475 }
459476
460477 // By default we update the view's presentation layer when setting backgroundColor and opacity properties.
0 commit comments