mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fixed mouse wrapping when scene viewport is inactive
This commit is contained in:
@@ -56,10 +56,15 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
ShowMenuBar();
|
||||
|
||||
var viewportSize = ImGui.GetContentRegionAvail();
|
||||
|
||||
if(ImGui.IsWindowHovered() && Input.IsMouseButtonPressing(.RightButton))
|
||||
{
|
||||
var currentWindow = ImGui.GetCurrentWindow();
|
||||
ImGui.FocusWindow(currentWindow);
|
||||
|
||||
if (_editor.CurrentCamera.[Friend]BindMouse)
|
||||
WrapMouseInViewport();
|
||||
}
|
||||
|
||||
_hasFocus = ImGui.IsWindowFocused();
|
||||
@@ -79,11 +84,6 @@ namespace GlitchyEditor.EditWindows
|
||||
_gizmoMode = .LOCAL;
|
||||
}
|
||||
|
||||
var viewportSize = ImGui.GetContentRegionAvail();
|
||||
|
||||
if (_editor.CurrentCamera.[Friend]BindMouse)
|
||||
WrapMouseInViewport();
|
||||
|
||||
if(_renderTarget != null)
|
||||
{
|
||||
ImGui.Image(_renderTarget.GetViewBinding(0), viewportSize);
|
||||
|
||||
Reference in New Issue
Block a user