Skip to content

Commit cd52d3d

Browse files
committed
fix(canvas): base class
1 parent fa1bde0 commit cd52d3d

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

packages/canvas/Canvas/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSType, View, Property, booleanConverter, Screen } from '@nativescript/core';
1+
import { CSSType, View, Property, booleanConverter, Screen, ContainerView } from '@nativescript/core';
22
import type { CanvasRenderingContext } from '../common';
33
import { removeItemFromArray } from './utils';
44

@@ -450,7 +450,7 @@ export function lengthToDevicePixels(value: any, parent: any, isWidth: boolean):
450450
}
451451

452452
@CSSType('Canvas')
453-
export abstract class CanvasBase extends View implements ICanvasBase {
453+
export abstract class CanvasBase extends ContainerView implements ICanvasBase {
454454
public static readyEvent = 'ready';
455455
ignoreTouchEvents: boolean;
456456
_isCustom: boolean = false;

packages/canvas/Canvas/index.ios.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -282,24 +282,6 @@ export class Canvas extends CanvasBase {
282282
}
283283
}
284284

285-
private _iosOverflowSafeArea = false;
286-
287-
//@ts-ignore
288-
get iosOverflowSafeArea() {
289-
return this._iosOverflowSafeArea;
290-
}
291-
292-
set iosOverflowSafeArea(value: boolean) {
293-
const window = UIApplication.sharedApplication.windows[0];
294-
//const topPadding = window.safeAreaInsets.top;
295-
const bottomPadding = window.safeAreaInsets.bottom;
296-
if (bottomPadding === 0) {
297-
this._iosOverflowSafeArea = false;
298-
} else {
299-
this._iosOverflowSafeArea = value;
300-
}
301-
}
302-
303285
static createCustomView() {
304286
const canvas = new Canvas();
305287
canvas._isCustom = true;

0 commit comments

Comments
 (0)