Browse Source

A few fixes on the Geometry Extensions

pull/637/head
jkuehner 11 years ago
parent
commit
755d653ef7
  1. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPathExtension.cs
  2. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PointTrackerPlacementSupport.cs
  3. 24
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PolyLineHandlerExtension.cs

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPathExtension.cs

@ -134,6 +134,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -134,6 +134,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
base.OnMouseDoubleClick(sender, e);
figure.Segments.RemoveAt(figure.Segments.Count - 1);
geometry.Properties[PathGeometry.FiguresProperty].SetValue(figure.ToString());
if (changeGroup != null) {

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PointTrackerPlacementSupport.cs

@ -66,17 +66,11 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -66,17 +66,11 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
p = new Point(x, y);
} else if (shape is Polygon) {
if (Index > 0)
{
var pg = shape as Polygon;
p = pg.Points[Index];
}
} else if (shape is Polyline) {
if (Index > 0)
{
var pg = shape as Polyline;
p = pg.Points[Index];
}
} else if (shape is Path) {
if (Index > 0)
{

24
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PolyLineHandlerExtension.cs

@ -157,27 +157,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -157,27 +157,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
_isResizing = true;
}
void ChangeOperation(PointCollection points)
{
//this is for SharpDevelop built in undo functionality
if (operation != null)
{
var info = operation.PlacedItems[0];
var result = info.OriginalBounds;
IEnumerable<double> xs = points.Select(x => x.X);
IEnumerable<double> ys = points.Select(y => y.Y);
result.X = (double)(info.Item.Properties.GetAttachedProperty(Canvas.LeftProperty).ValueOnInstance);
result.Y = (double)(info.Item.Properties.GetAttachedProperty(Canvas.TopProperty).ValueOnInstance);
result.Width = xs.Max() - xs.Min();
result.Height = ys.Max() - ys.Min();
info.Bounds = result.Round();
operation.CurrentContainerBehavior.BeforeSetPosition(operation);
operation.CurrentContainerBehavior.SetPosition(info);
}
}
void CommitOperation()
{
if (operation != null)
@ -298,7 +277,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -298,7 +277,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
points = MovePoints(points, dx, dy, theta, snapAngle);
}
ChangeOperation(points);
(drag.Target as ResizeThumb).InvalidateArrange();
}
@ -415,7 +394,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -415,7 +394,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
var dx2 = (e.Key == Key.Right) ? Keyboard.IsKeyDown(Key.LeftShift) ? _movingDistance + 10 : _movingDistance + 1 : 0;
var dy2 = (e.Key == Key.Down) ? Keyboard.IsKeyDown(Key.LeftShift) ? _movingDistance + 10 : _movingDistance + 1 : 0;
ChangeOperation(MovePoints(GetPointCollection(), dx1 + dx2, dy1 + dy2, 0, null));
_movingDistance = (dx1 + dx2 + dy1 + dy2);
}

Loading…
Cancel
Save