mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
apply bottom and right safe area inset to views
This commit is contained in:
@@ -256,13 +256,13 @@ export class View extends ViewCommon {
|
||||
return { left, right, top, bottom };
|
||||
}
|
||||
|
||||
public getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top }): CGRect {
|
||||
insets = insets || { left: 0, top: 0 };
|
||||
public getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top, right, bottom }): CGRect {
|
||||
insets = insets || { left: 0, top: 0, right: 0, bottom: 0 };
|
||||
|
||||
const left = layout.round(layout.toDeviceIndependentPixels(position.left + insets.left));
|
||||
const top = layout.round(layout.toDeviceIndependentPixels(position.top + insets.top));
|
||||
const width = layout.round(layout.toDeviceIndependentPixels(position.right - position.left));
|
||||
const height = layout.round(layout.toDeviceIndependentPixels(position.bottom - position.top));
|
||||
const width = layout.round(layout.toDeviceIndependentPixels(position.right - position.left - insets.left - insets.right));
|
||||
const height = layout.round(layout.toDeviceIndependentPixels(position.bottom - position.top - insets.top - insets.bottom));
|
||||
|
||||
return CGRectMake(left, top, width, height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user