Browse Source

Simplification of code

pull/476/head
tbulle 11 years ago
parent
commit
c825585043
  1. 12
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs

12
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 (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) { if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) {
bounds.Y += delta; bounds.Y += delta;
bounds.Height = Math.Max(0, bounds.Height - delta);
} else {
bounds.Height = Math.Max(0, bounds.Height + delta);
} }
bounds.Height = Math.Max(0, bounds.Height - delta);
info.Bounds = bounds; info.Bounds = bounds;
} else { } else {
foreach (var item in operation.PlacedItems) { foreach (var item in operation.PlacedItems) {
@ -139,11 +137,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (operation.Type == PlacementType.Resize) { if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) { if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) {
bounds.X += delta; bounds.X += delta;
bounds.Width = Math.Max(0, bounds.Width - delta);
} else {
bounds.Width = Math.Max(0, bounds.Width + delta);
} }
bounds.Width = Math.Max(0, bounds.Width - delta);
info.Bounds = bounds; info.Bounds = bounds;
} else { } else {
foreach (var item in operation.PlacedItems) { foreach (var item in operation.PlacedItems) {

Loading…
Cancel
Save