From c825585043caa94fe741a7970728c160fa48fed1 Mon Sep 17 00:00:00 2001 From: tbulle Date: Wed, 14 May 2014 14:56:47 +0200 Subject: [PATCH] Simplification of code --- .../Project/Extensions/SnaplinePlacementBehavior.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs index 8242243e39..b145816386 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs @@ -116,11 +116,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions if (operation.Type == PlacementType.Resize) { if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) { - bounds.Y += delta; - bounds.Height = Math.Max(0, bounds.Height - delta); - } else { - bounds.Height = Math.Max(0, bounds.Height + delta); + bounds.Y += delta; } + bounds.Height = Math.Max(0, bounds.Height - delta); info.Bounds = bounds; } else { foreach (var item in operation.PlacedItems) { @@ -139,11 +137,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions if (operation.Type == PlacementType.Resize) { if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) { - bounds.X += delta; - bounds.Width = Math.Max(0, bounds.Width - delta); - } else { - bounds.Width = Math.Max(0, bounds.Width + delta); + bounds.X += delta; } + bounds.Width = Math.Max(0, bounds.Width - delta); info.Bounds = bounds; } else { foreach (var item in operation.PlacedItems) {