(nativeView: NativeScriptUIView, background: BackgroundDefinition)
| 361 | } |
| 362 | |
| 363 | function maskLayerIfNeeded(nativeView: NativeScriptUIView, background: BackgroundDefinition) { |
| 364 | const layer: CALayer = nativeView.layer; |
| 365 | |
| 366 | // Check if layer should be masked |
| 367 | if (!(layer.mask instanceof CAShapeLayer)) { |
| 368 | // Since layers can only accept up to a single mask at a time, clip path is given more priority |
| 369 | if (background.clipPath) { |
| 370 | nativeView.maskType = iosViewUtils.LayerMask.CLIP_PATH; |
| 371 | } else if (!background.hasUniformBorder() && background.hasBorderRadius()) { |
| 372 | nativeView.maskType = iosViewUtils.LayerMask.BORDER; |
| 373 | } else { |
| 374 | nativeView.maskType = null; |
| 375 | } |
| 376 | |
| 377 | if (nativeView.maskType != null) { |
| 378 | nativeView.originalMask = layer.mask; |
| 379 | layer.mask = CAShapeLayer.new(); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | function clearLayerMask(nativeView: NativeScriptUIView) { |
| 385 | if (nativeView.outerShadowContainerLayer) { |
no test coverage detected