fix-next: restrict to safe area when transform (#6405)

This commit is contained in:
Martin Yankov
2018-10-15 10:17:56 +03:00
committed by GitHub
parent 829d18b56d
commit 7e891a91f9

View File

@ -159,6 +159,7 @@ export class View extends ViewCommon {
traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout); traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout);
} }
this._cachedFrame = frame; this._cachedFrame = frame;
let adjustedFrame = null;
if (this._hasTransfrom) { if (this._hasTransfrom) {
// Always set identity transform before setting frame; // Always set identity transform before setting frame;
const transform = nativeView.transform; const transform = nativeView.transform;
@ -167,11 +168,11 @@ export class View extends ViewCommon {
nativeView.transform = transform; nativeView.transform = transform;
} else { } else {
nativeView.frame = frame; nativeView.frame = frame;
} // apply safe area insets only if no transform is in place
adjustedFrame = this.applySafeAreaInsets(frame);
const adjustedFrame = this.applySafeAreaInsets(frame); if (adjustedFrame) {
if (adjustedFrame) { nativeView.frame = adjustedFrame;
nativeView.frame = adjustedFrame; }
} }
const boundsOrigin = nativeView.bounds.origin; const boundsOrigin = nativeView.bounds.origin;