예제 #1
0
        public static void DrawAdorner(DrawingContext drawingContext, Point anchorPoint, EdgeFlags edgeFlags, Matrix matrix, Brush brush, Rect bounds)
        {
            Size ofTransformedRect = Adorner.GetSizeOfTransformedRect(bounds, matrix);

            if ((edgeFlags == EdgeFlags.Top || edgeFlags == EdgeFlags.Bottom) && (ofTransformedRect.Width < RotateAdornerHelper.Radius * 2.0 || ofTransformedRect.Height < SizeAdorner.Size) || (edgeFlags == EdgeFlags.Left || edgeFlags == EdgeFlags.Right) && (ofTransformedRect.Height < RotateAdornerHelper.Radius * 2.0 || ofTransformedRect.Width < SizeAdorner.Size) || (edgeFlags == EdgeFlags.TopLeft || edgeFlags == EdgeFlags.TopRight || (edgeFlags == EdgeFlags.BottomLeft || edgeFlags == EdgeFlags.BottomRight)) && (ofTransformedRect.Width < SizeAdorner.Size && ofTransformedRect.Height < SizeAdorner.Size))
            {
                return;
            }
            RotateAdornerHelper.DrawAdorner(drawingContext, anchorPoint, edgeFlags, matrix, brush);
        }
예제 #2
0
        public override void Draw(DrawingContext ctx, Matrix matrix)
        {
            if (!this.ShouldDraw || PlatformTypes.IsInstance(this.PlatformBrush, PlatformTypes.LinearGradientBrush, (ITypeResolver)this.Element.ProjectContext) && this.AdornerSet.Behavior.Tool is GradientBrushTool)
            {
                return;
            }
            Rect brushBounds = this.BrushBounds;

            if (brushBounds.Width > 0.0 && brushBounds.Height > 0.0)
            {
                Point  anchorPoint = this.GetAnchorPoint(matrix);
                Matrix matrix1     = this.GetCompleteBrushTransformMatrix(true) * matrix;
                RotateAdornerHelper.DrawAdorner(ctx, anchorPoint, this.EdgeFlags, matrix1, (Brush)Brushes.Transparent);
            }
            else
            {
                if (brushBounds.Width <= 0.0 && brushBounds.Height <= 0.0 || this.EdgeFlags != EdgeFlags.TopLeft && this.EdgeFlags != EdgeFlags.BottomRight)
                {
                    return;
                }
                Point anchorPoint = this.GetAnchorPoint(matrix);
                ctx.DrawEllipse((Brush)Brushes.Transparent, (Pen)null, anchorPoint, RotateAdornerHelper.Radius, RotateAdornerHelper.Radius);
            }
        }
예제 #3
0
        public override void Draw(DrawingContext ctx, Matrix matrix)
        {
            Point anchorPoint = this.GetAnchorPoint(matrix);

            RotateAdornerHelper.DrawAdorner(ctx, anchorPoint, this.EdgeFlags, matrix, (Brush)Brushes.Transparent, this.ElementBounds);
        }