Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit ee47222

Browse files
authored
Merge pull request #239 from UnityTech/fix_prefab
Fix prefab editing error.
2 parents 220ce21 + 20dc37d commit ee47222

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Runtime/editor/editor_window.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,6 @@ public void OnEnable() {
182182
this._devicePixelRatio = this.queryDevicePixelRatio();
183183
this._antiAliasing = this.queryAntiAliasing();
184184

185-
var size = this.queryWindowSize();
186-
this._lastWindowWidth = size.x;
187-
this._lastWindowHeight = size.y;
188-
this._physicalSize = new Size(
189-
this._lastWindowWidth * this._devicePixelRatio,
190-
this._lastWindowHeight * this._devicePixelRatio);
191-
192185
this.updateSafeArea();
193186
D.assert(this._surface == null);
194187
this._surface = this.createSurface();
@@ -444,6 +437,15 @@ void _updateScrollInput(float deltaTime) {
444437
}
445438

446439
public void Update() {
440+
if (this._physicalSize == null) {
441+
var size = this.queryWindowSize();
442+
this._lastWindowWidth = size.x;
443+
this._lastWindowHeight = size.y;
444+
this._physicalSize = new Size(
445+
this._lastWindowWidth * this._devicePixelRatio,
446+
this._lastWindowHeight * this._devicePixelRatio);
447+
}
448+
447449
this.updateDeltaTime();
448450
this.updateFPS(this.unscaledDeltaTime);
449451

@@ -458,10 +460,10 @@ public void Update() {
458460
this.flushMicrotasks();
459461
}
460462
}
461-
463+
462464
static readonly TimeSpan _coolDownDelay = new TimeSpan(0, 0, 0, 0, 200);
463465
static Timer frameCoolDownTimer;
464-
466+
465467
public override void scheduleFrame(bool regenerateLayerTree = true) {
466468
if (regenerateLayerTree) {
467469
this._regenerateLayerTree = true;

0 commit comments

Comments
 (0)