Fix shape positioning on layer LED selection change

This commit is contained in:
Robert committed 2020-01-30 17:34:50 +01:00
1 parent cd1b75750e
commit f57aca3475
14 files changed
+89 -50

No files matched your search

@@ -53,9 +53,9 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
if (ProfileEditorService.SelectedProfileElement is Layer layer)
{
// If the layer has a shape, save it's size
var shapeSize = Rect.Empty;
var shapeSize = SKRect.Empty;
if (layer.LayerShape != null)
shapeSize = _layerEditorService.GetShapeRenderRect(layer.LayerShape);
shapeSize = layer.LayerShape.GetUnscaledRectangle();
// If shift is held down, add to the selection instead of replacing it
if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
@@ -68,7 +68,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
// Restore the saved size
if (layer.LayerShape != null)
_layerEditorService.SetShapeRenderRect(layer.LayerShape, shapeSize);
layer.LayerShape.SetFromUnscaledRectangle(shapeSize);
ProfileEditorService.UpdateSelectedProfileElement();
}