Moved check and ops to also fix issue #683
This commit is contained in:
@@ -37,6 +37,16 @@ namespace FlaxEditor.GUI.Docking
|
||||
// Focus window
|
||||
window.Focus();
|
||||
|
||||
// Check if window is maximized and restore window.
|
||||
if (window.IsMaximized)
|
||||
{
|
||||
// Restore window and set position to mouse.
|
||||
var mousePos = window.MousePosition;
|
||||
var previousSize = window.Size;
|
||||
window.Restore();
|
||||
window.Position = FlaxEngine.Input.MouseScreenPosition - mousePos * window.Size / previousSize;
|
||||
}
|
||||
|
||||
// Calculate dragging offset and move window to the destination position
|
||||
var mouseScreenPosition = FlaxEngine.Input.MouseScreenPosition;
|
||||
|
||||
|
||||
@@ -51,16 +51,6 @@ namespace FlaxEditor.GUI.Docking
|
||||
if (_window == null)
|
||||
return;
|
||||
|
||||
// Check if window is maximized
|
||||
if (_window.IsMaximized)
|
||||
{
|
||||
// Restore window and set position to mouse.
|
||||
var mousePos = _window.MousePosition;
|
||||
var previousSize = _window.Size;
|
||||
_window.Restore();
|
||||
_window.Window.Position = FlaxEngine.Input.MouseScreenPosition - mousePos * _window.Size / previousSize;
|
||||
}
|
||||
|
||||
// Create docking hint window
|
||||
DockHintWindow.Create(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user