Hooked up rotation and opacity

This commit is contained in:
Robert committed 2020-01-15 20:06:07 +01:00
1 parent ae330c3769
commit 5069be4af4
9 files changed
+202 -137

No files matched your search

@@ -25,6 +25,7 @@ namespace Artemis.UI.Screens.Shared
public double PanY { get; set; }
public double CanvasWidth { get; set; }
public double CanvasHeight { get; set; }
public bool LimitToZero { get; set; }
public Rect BackgroundViewport => new Rect(PanX, PanY, 20, 20);
@@ -61,8 +62,16 @@ namespace Artemis.UI.Screens.Shared
var position = e.GetPosition((IInputElement) sender);
var delta = LastPanPosition - position;
PanX = Math.Min(0, PanX - delta.Value.X);
PanY = Math.Min(0, PanY - delta.Value.Y);
if (LimitToZero)
{
PanX = Math.Min(0, PanX - delta.Value.X);
PanY = Math.Min(0, PanY - delta.Value.Y);
}
else
{
PanX -= delta.Value.X;
PanY -= delta.Value.Y;
}
LastPanPosition = position;
}