Merge branch 'editor_viewport_camera_scaling' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-editor_viewport_camera_scaling

This commit is contained in:
Wojtek Figat
2024-04-12 12:56:22 +02:00
3 changed files with 6 additions and 8 deletions

View File

@@ -76,7 +76,7 @@ namespace FlaxEditor.Viewport
public bool SnapToVertex => ContainsFocus && Editor.Instance.Options.Options.Input.SnapToVertex.Process(Root);
/// <inheritdoc />
public Float2 MouseDelta => _mouseDelta * 1000;
public Float2 MouseDelta => _mouseDelta;
/// <inheritdoc />
public bool UseSnapping => Root?.GetKey(KeyboardKeys.Control) ?? false;

View File

@@ -1663,8 +1663,7 @@ namespace FlaxEditor.Viewport
{
offset.X = offset.X > 0 ? Mathf.Floor(offset.X) : Mathf.Ceil(offset.X);
offset.Y = offset.Y > 0 ? Mathf.Floor(offset.Y) : Mathf.Ceil(offset.Y);
_mouseDelta = offset / size;
_mouseDelta.Y *= size.Y / size.X;
_mouseDelta = offset;
// Update delta filtering buffer
_deltaFilteringBuffer[_deltaFilteringStep] = _mouseDelta;
@@ -1682,8 +1681,7 @@ namespace FlaxEditor.Viewport
}
else
{
_mouseDelta = offset / size;
_mouseDelta.Y *= size.Y / size.X;
_mouseDelta = offset;
mouseDelta = _mouseDelta;
}
@@ -1697,7 +1695,7 @@ namespace FlaxEditor.Viewport
// Update
moveDelta *= dt * (60.0f * 4.0f);
mouseDelta *= 200.0f * MouseSpeed * _mouseSensitivity;
mouseDelta *= 0.1833f * MouseSpeed * _mouseSensitivity;
UpdateView(dt, ref moveDelta, ref mouseDelta, out var centerMouse);
// Move mouse back to the root position
@@ -1723,7 +1721,7 @@ namespace FlaxEditor.Viewport
var offset = _viewMousePos - _startPos;
offset.X = offset.X > 0 ? Mathf.Floor(offset.X) : Mathf.Ceil(offset.X);
offset.Y = offset.Y > 0 ? Mathf.Floor(offset.Y) : Mathf.Ceil(offset.Y);
_mouseDelta = offset / size;
_mouseDelta = offset;
_startPos = _viewMousePos;
}
else

View File

@@ -291,7 +291,7 @@ namespace FlaxEditor.Viewport
public bool SnapToVertex => ContainsFocus && Editor.Instance.Options.Options.Input.SnapToVertex.Process(Root);
/// <inheritdoc />
public Float2 MouseDelta => _mouseDelta * 1000;
public Float2 MouseDelta => _mouseDelta;
/// <inheritdoc />
public bool UseSnapping => Root.GetKey(KeyboardKeys.Control);