Working on render logic

This commit is contained in:
Robert committed 2019-10-23 17:35:13 +02:00
1 parent c2c849201d
commit 9badc666e8
8 files changed
+50 -19

No files matched your search

@@ -63,8 +63,8 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
{
var roundedX = Math.Round((mousePosition.X + _dragOffsetX) / 10, 0, MidpointRounding.AwayFromZero) * 10;
var roundedY = Math.Round((mousePosition.Y + _dragOffsetY) / 10, 0, MidpointRounding.AwayFromZero) * 10;
X = roundedX;
Y = roundedY;
X = Math.Max(0, roundedX);
Y = Math.Max(0, roundedY);
}
// ReSharper disable once UnusedMember.Global - Called from view
@@ -42,8 +42,8 @@ namespace Artemis.UI.ViewModels
Zoom = Math.Max(0.1, Math.Min(4, Zoom));
// Update the PanX/Y to enable zooming relative to cursor
PanX = absoluteX - relative.X * Zoom;
PanY = absoluteY - relative.Y * Zoom;
PanX = Math.Min(0, absoluteX - relative.X * Zoom);
PanY = Math.Min(0, absoluteY - relative.Y * Zoom);
}
public void ProcessMouseMove(object sender, MouseEventArgs e)
@@ -60,9 +60,10 @@ namespace Artemis.UI.ViewModels
var position = e.GetPosition((IInputElement) sender);
var delta = _lastPanPosition - position;
PanX -= delta.Value.X;
PanY -= delta.Value.Y;
PanX = Math.Min(0, PanX - delta.Value.X);
PanY = Math.Min(0, PanY - delta.Value.Y);
_lastPanPosition = position;
}
@@ -105,6 +105,8 @@ namespace Artemis.UI.ViewModels.Screens
Devices.Add(viewModel);
});
});
_surfaceService.ActiveSurfaceConfiguration = SelectedSurfaceConfiguration;
}
#region Overrides of Screen