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

Commit c410a20

Browse files
author
tbulle
committed
Nullable ResizeThumbAlignment to enable both top and bottom snap on resize simultaneously
1 parent 929fc8e commit c410a20

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public override void BeforeSetPosition(PlacementOperation operation)
115115
if (Snap(horizontalInput, horizontalMap, Accuracy, out drawLines, out delta)) {
116116

117117
if (operation.Type == PlacementType.Resize) {
118-
if (info.ResizeThumbAlignment.Vertical == VerticalAlignment.Top) {
118+
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) {
119119
bounds.Y += delta;
120120
bounds.Height = Math.Max(0, bounds.Height - delta);
121121
} else {
@@ -138,7 +138,7 @@ public override void BeforeSetPosition(PlacementOperation operation)
138138
if (Snap(verticalInput, verticalMap, Accuracy, out drawLines, out delta)) {
139139

140140
if (operation.Type == PlacementType.Resize) {
141-
if (info.ResizeThumbAlignment.Horizontal == HorizontalAlignment.Left) {
141+
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) {
142142
bounds.X += delta;
143143
bounds.Width = Math.Max(0, bounds.Width - delta);
144144
} else {

src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Rect Bounds {
7575
/// <summary>
7676
/// Gets/sets the alignment of the resize thumb used to start the operation.
7777
/// </summary>
78-
public PlacementAlignment ResizeThumbAlignment { get; set; }
78+
public PlacementAlignment? ResizeThumbAlignment { get; set; }
7979

8080
/// <inheritdoc/>
8181
public override string ToString()

0 commit comments

Comments
 (0)