|
|
|
@ -389,10 +389,17 @@ namespace ICSharpCode.WpfDesign.Designer
@@ -389,10 +389,17 @@ namespace ICSharpCode.WpfDesign.Designer
|
|
|
|
|
if (e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Up || e.Key == Key.Down) { |
|
|
|
|
e.Handled = true; |
|
|
|
|
|
|
|
|
|
PlacementType placementType = Keyboard.IsKeyDown(Key.LeftCtrl) ? PlacementType.Resize : PlacementType.Move; |
|
|
|
|
|
|
|
|
|
if (placementOp != null && placementOp.Type != placementType) { |
|
|
|
|
placementOp.Commit(); |
|
|
|
|
placementOp = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (placementOp == null) { |
|
|
|
|
dx = 0; |
|
|
|
|
dy = 0; |
|
|
|
|
placementOp = PlacementOperation.Start(Context.Services.Selection.SelectedItems, PlacementType.Move); |
|
|
|
|
placementOp = PlacementOperation.Start(Context.Services.Selection.SelectedItems, placementType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (e.Key) { |
|
|
|
@ -414,17 +421,17 @@ namespace ICSharpCode.WpfDesign.Designer
@@ -414,17 +421,17 @@ namespace ICSharpCode.WpfDesign.Designer
|
|
|
|
|
{ |
|
|
|
|
var bounds = info.OriginalBounds; |
|
|
|
|
|
|
|
|
|
if (!Keyboard.IsKeyDown(Key.LeftCtrl)) { |
|
|
|
|
if (placementType == PlacementType.Move) { |
|
|
|
|
info.Bounds = new Rect(bounds.Left + dx, |
|
|
|
|
bounds.Top + dy, |
|
|
|
|
bounds.Width, |
|
|
|
|
bounds.Height); |
|
|
|
|
} else { |
|
|
|
|
if (info.OriginalBounds.Width + dx >= 0 && info.OriginalBounds.Height + dy >= 0) { |
|
|
|
|
info.Bounds = new Rect(info.OriginalBounds.Left, |
|
|
|
|
info.OriginalBounds.Top, |
|
|
|
|
info.OriginalBounds.Width + dx, |
|
|
|
|
info.OriginalBounds.Height + dy); |
|
|
|
|
} else if (placementType == PlacementType.Resize) { |
|
|
|
|
if (bounds.Width + dx >= 0 && bounds.Height + dy >= 0) { |
|
|
|
|
info.Bounds = new Rect(bounds.Left, |
|
|
|
|
bounds.Top, |
|
|
|
|
bounds.Width + dx, |
|
|
|
|
bounds.Height + dy); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|