프로젝트

일반

사용자정보

개정판 d251456f

IDd251456ff29093c83c7ce74cce90aab1cfa01f58
상위 59e0aa5f
하위 6d1a8228

백흠경이(가) 5년 이상 전에 추가함

issue #214: adjust arrow size

Change-Id: I8aa507c61ea8a6dd72eb180f30d8493feed515ac

차이점 보기:

MarkupToPDF/Controls/Line/ArrowControl_Multi.cs
262 262
            if (this.MiddlePoint == new Point(0,0))
263 263
            {
264 264
                //instanceGroup.Children.Add(SingleAllow(this.StartPoint, this.MiddlePoint, this.LineSize));
265
                instanceGroup.Children.Add(SingleAllow(this.StartPoint, this.EndPoint, this.LineSize));
265
                instanceGroup.Children.Add(DrawSet.DrawArrow(this.StartPoint, this.EndPoint, this.LineSize));
266 266
            }
267 267
            else
268 268
            {
269
                instanceGroup.Children.Add(SingleAllow(this.MiddlePoint, this.EndPoint, this.LineSize));
269
                instanceGroup.Children.Add(DrawSet.DrawArrow(this.MiddlePoint, this.EndPoint, this.LineSize));
270 270
                LineSegment lineSegment1 = new LineSegment();
271 271
                lineSegment1.Point = this.MiddlePoint;
272 272
                pathFigure.Segments.Add(lineSegment1);
......
335 335
        //    return pathGeometry;
336 336
        //}
337 337

  
338
        public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize)
339
        {
340
            double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI;
341
            PathGeometry pathGeometry = new PathGeometry();
342
            PathFigure pathFigure = new PathFigure();
343
            pathFigure.StartPoint = p1;
344
            //lineSize = 2;
345
            Point lpoint = new Point(p1.X + lineSize * 3, p1.Y + lineSize * 6);
346
            Point rpoint = new Point(p1.X - lineSize * 3, p1.Y + lineSize * 6);
347

  
348
            LineSegment seg1 = new LineSegment();
349
            seg1.Point = lpoint;
350
            pathFigure.Segments.Add(seg1);
351

  
352
            LineSegment seg2 = new LineSegment();
353
            seg2.Point = rpoint;
354
            pathFigure.Segments.Add(seg2);
355

  
356
            LineSegment seg3 = new LineSegment();
357
            seg3.Point = p1;
358
            pathFigure.Segments.Add(seg3);
359

  
360
            pathFigure.IsClosed = true;
361
            pathFigure.IsFilled = true;
362

  
363
            pathGeometry.Figures.Add(pathFigure);
364
            pathGeometry.FillRule = FillRule.Nonzero;
365
            RotateTransform transform = new RotateTransform();
366
            transform.Angle = theta - 90;
367
            transform.CenterX = p1.X;
368
            transform.CenterY = p1.Y;
369
            pathGeometry.Transform = transform;
370
            return pathGeometry;
371
        }
372 338
        protected void OnPropertyChanged(string propName)
373 339
        {
374 340
            if (PropertyChanged != null)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)