File tree 2 files changed +6
-18
lines changed
2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -155,21 +155,13 @@ export class View extends ViewCommon implements ViewDefinition {
155
155
156
156
private layoutOuterShadows ( ) : void {
157
157
const nativeView : NativeScriptUIView = < NativeScriptUIView > this . nativeViewProtected ;
158
- if ( nativeView ) {
159
- const frame = nativeView . frame ;
160
- const needsUpdate : boolean = nativeView . outerShadowContainerLayer != null ;
158
+ if ( nativeView ?. outerShadowContainerLayer ) {
159
+ CATransaction . setDisableActions ( true ) ;
161
160
162
- if ( needsUpdate ) {
163
- CATransaction . setDisableActions ( true ) ;
161
+ nativeView . outerShadowContainerLayer . bounds = nativeView . bounds ;
162
+ nativeView . outerShadowContainerLayer . position = nativeView . center ;
164
163
165
- if ( nativeView . outerShadowContainerLayer ) {
166
- const { x : originX , y : originY } : CGPoint = nativeView . outerShadowContainerLayer . anchorPoint ;
167
- nativeView . outerShadowContainerLayer . bounds = nativeView . bounds ;
168
- nativeView . outerShadowContainerLayer . position = CGPointMake ( frame . origin . x + frame . size . width * originX , frame . origin . y + frame . size . height * originY ) ;
169
- }
170
-
171
- CATransaction . setDisableActions ( false ) ;
172
- }
164
+ CATransaction . setDisableActions ( false ) ;
173
165
}
174
166
}
175
167
Original file line number Diff line number Diff line change @@ -1091,7 +1091,6 @@ function drawBoxShadow(view: View): void {
1091
1091
}
1092
1092
1093
1093
const bounds = nativeView . bounds ;
1094
- const viewFrame = nativeView . frame ;
1095
1094
const boxShadow : BoxShadow = background . getBoxShadow ( ) ;
1096
1095
1097
1096
// Initialize outer shadows
@@ -1127,10 +1126,7 @@ function drawBoxShadow(view: View): void {
1127
1126
1128
1127
outerShadowContainerLayer . bounds = bounds ;
1129
1128
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 : originX , y : originY } : CGPoint = outerShadowContainerLayer . anchorPoint ;
1133
- outerShadowContainerLayer . position = CGPointMake ( viewFrame . origin . x + viewFrame . size . width * originX , viewFrame . origin . y + viewFrame . size . height * originY ) ;
1129
+ outerShadowContainerLayer . position = nativeView . center ;
1134
1130
1135
1131
// Inherit view visibility values
1136
1132
outerShadowContainerLayer . opacity = layer . opacity ;
You can’t perform that action at this time.
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy
0 commit comments