Browse Source

Allows placementoperation to take null for PlacementAlignment so that all snaplines can be shown at the same time on resize operations

pull/483/head
tbulle 11 years ago
parent
commit
ca037b0938
  1. 4
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs
  2. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs

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

@ -115,7 +115,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -115,7 +115,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (Snap(horizontalInput, horizontalMap, Accuracy, out drawLines, out delta)) {
if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment.Vertical == VerticalAlignment.Top) {
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) {
bounds.Y += delta;
bounds.Height = Math.Max(0, bounds.Height - delta);
} else {
@ -138,7 +138,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -138,7 +138,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (Snap(verticalInput, verticalMap, Accuracy, out drawLines, out delta)) {
if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment.Horizontal == HorizontalAlignment.Left) {
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) {
bounds.X += delta;
bounds.Width = Math.Max(0, bounds.Width - delta);
} else {

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

@ -75,7 +75,7 @@ namespace ICSharpCode.WpfDesign @@ -75,7 +75,7 @@ namespace ICSharpCode.WpfDesign
/// <summary>
/// Gets/sets the alignment of the resize thumb used to start the operation.
/// </summary>
public PlacementAlignment ResizeThumbAlignment { get; set; }
public PlacementAlignment? ResizeThumbAlignment { get; set; }
/// <inheritdoc/>
public override string ToString()

Loading…
Cancel
Save