Browse Source

Posibility to draw a freeform while keeping Mouse Button Pressed

pull/637/head
jkuehner 11 years ago
parent
commit
1af21b6ded
  1. 12
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPolyLineExtension.cs

12
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPolyLineExtension.cs

@ -107,13 +107,17 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (newLine.View is Polyline) { if (newLine.View is Polyline) {
if (((Polyline)newLine.View).Points.Count <= 1) if (((Polyline)newLine.View).Points.Count <= 1)
((Polyline)newLine.View).Points.Add(point); ((Polyline)newLine.View).Points.Add(point);
((Polyline)newLine.View).Points.RemoveAt(((Polyline)newLine.View).Points.Count - 1); if (Mouse.LeftButton != MouseButtonState.Pressed)
((Polyline)newLine.View).Points.Add(point); ((Polyline)newLine.View).Points.RemoveAt(((Polyline)newLine.View).Points.Count - 1);
if (((Polyline)newLine.View).Points.Last() != point)
((Polyline)newLine.View).Points.Add(point);
} else { } else {
if (((Polygon)newLine.View).Points.Count <= 1) if (((Polygon)newLine.View).Points.Count <= 1)
((Polygon)newLine.View).Points.Add(point); ((Polygon)newLine.View).Points.Add(point);
((Polygon)newLine.View).Points.RemoveAt(((Polygon)newLine.View).Points.Count - 1); if (Mouse.LeftButton != MouseButtonState.Pressed)
((Polygon)newLine.View).Points.Add(point); ((Polygon)newLine.View).Points.RemoveAt(((Polygon)newLine.View).Points.Count - 1);
if (((Polygon)newLine.View).Points.Last() != point)
((Polygon)newLine.View).Points.Add(point);
} }
} }

Loading…
Cancel
Save