Merge branch 'editor_viewport_camera_scaling' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-editor_viewport_camera_scaling
This commit is contained in:
@@ -76,7 +76,7 @@ namespace FlaxEditor.Viewport
|
|||||||
public bool SnapToVertex => ContainsFocus && Editor.Instance.Options.Options.Input.SnapToVertex.Process(Root);
|
public bool SnapToVertex => ContainsFocus && Editor.Instance.Options.Options.Input.SnapToVertex.Process(Root);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Float2 MouseDelta => _mouseDelta * 1000;
|
public Float2 MouseDelta => _mouseDelta;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool UseSnapping => Root?.GetKey(KeyboardKeys.Control) ?? false;
|
public bool UseSnapping => Root?.GetKey(KeyboardKeys.Control) ?? false;
|
||||||
|
|||||||
@@ -1663,8 +1663,7 @@ namespace FlaxEditor.Viewport
|
|||||||
{
|
{
|
||||||
offset.X = offset.X > 0 ? Mathf.Floor(offset.X) : Mathf.Ceil(offset.X);
|
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);
|
offset.Y = offset.Y > 0 ? Mathf.Floor(offset.Y) : Mathf.Ceil(offset.Y);
|
||||||
_mouseDelta = offset / size;
|
_mouseDelta = offset;
|
||||||
_mouseDelta.Y *= size.Y / size.X;
|
|
||||||
|
|
||||||
// Update delta filtering buffer
|
// Update delta filtering buffer
|
||||||
_deltaFilteringBuffer[_deltaFilteringStep] = _mouseDelta;
|
_deltaFilteringBuffer[_deltaFilteringStep] = _mouseDelta;
|
||||||
@@ -1682,8 +1681,7 @@ namespace FlaxEditor.Viewport
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_mouseDelta = offset / size;
|
_mouseDelta = offset;
|
||||||
_mouseDelta.Y *= size.Y / size.X;
|
|
||||||
mouseDelta = _mouseDelta;
|
mouseDelta = _mouseDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1697,7 +1695,7 @@ namespace FlaxEditor.Viewport
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
moveDelta *= dt * (60.0f * 4.0f);
|
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);
|
UpdateView(dt, ref moveDelta, ref mouseDelta, out var centerMouse);
|
||||||
|
|
||||||
// Move mouse back to the root position
|
// Move mouse back to the root position
|
||||||
@@ -1723,7 +1721,7 @@ namespace FlaxEditor.Viewport
|
|||||||
var offset = _viewMousePos - _startPos;
|
var offset = _viewMousePos - _startPos;
|
||||||
offset.X = offset.X > 0 ? Mathf.Floor(offset.X) : Mathf.Ceil(offset.X);
|
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);
|
offset.Y = offset.Y > 0 ? Mathf.Floor(offset.Y) : Mathf.Ceil(offset.Y);
|
||||||
_mouseDelta = offset / size;
|
_mouseDelta = offset;
|
||||||
_startPos = _viewMousePos;
|
_startPos = _viewMousePos;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ namespace FlaxEditor.Viewport
|
|||||||
public bool SnapToVertex => ContainsFocus && Editor.Instance.Options.Options.Input.SnapToVertex.Process(Root);
|
public bool SnapToVertex => ContainsFocus && Editor.Instance.Options.Options.Input.SnapToVertex.Process(Root);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Float2 MouseDelta => _mouseDelta * 1000;
|
public Float2 MouseDelta => _mouseDelta;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool UseSnapping => Root.GetKey(KeyboardKeys.Control);
|
public bool UseSnapping => Root.GetKey(KeyboardKeys.Control);
|
||||||
|
|||||||
Reference in New Issue
Block a user