Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit c825585

Browse files
author
tbulle
committed
Simplification of code
1 parent c410a20 commit c825585

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,9 @@ public override void BeforeSetPosition(PlacementOperation operation)
116116

117117
if (operation.Type == PlacementType.Resize) {
118118
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) {
119-
bounds.Y += delta;
120-
bounds.Height = Math.Max(0, bounds.Height - delta);
121-
} else {
122-
bounds.Height = Math.Max(0, bounds.Height + delta);
119+
bounds.Y += delta;
123120
}
121+
bounds.Height = Math.Max(0, bounds.Height - delta);
124122
info.Bounds = bounds;
125123
} else {
126124
foreach (var item in operation.PlacedItems) {
@@ -139,11 +137,9 @@ public override void BeforeSetPosition(PlacementOperation operation)
139137

140138
if (operation.Type == PlacementType.Resize) {
141139
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) {
142-
bounds.X += delta;
143-
bounds.Width = Math.Max(0, bounds.Width - delta);
144-
} else {
145-
bounds.Width = Math.Max(0, bounds.Width + delta);
140+
bounds.X += delta;
146141
}
142+
bounds.Width = Math.Max(0, bounds.Width - delta);
147143
info.Bounds = bounds;
148144
} else {
149145
foreach (var item in operation.PlacedItems) {

0 commit comments

Comments
 (0)