프로젝트

일반

사용자정보

개정판 f7ca524b

IDf7ca524b8449133f63969d0441660f6240999b74
상위 d16e0d12
하위 71ee71d2

백흠경이(가) 9달 전에 추가함

Fix: 텍스트 컨트롤의 Cloud Mark 크기 조절 오류 수정

Change-Id: Idbcb94c257f6c3ece2a39089c7802ab10d03e21a

차이점 보기:

MarkupToPDF/Controls/Text/TextControl.cs
309 309
                        break;
310 310
                    case 2:
311 311
                        {
312
                            PathData = (Generate(pCloud));
312
                            PathData = (Generate(pCloud, this.ArcLength));
313 313
                            PathDataInner = (GenerateInner(pCloud));
314 314
                        }
315 315
                        break;
316 316
                }
317 317
            }
318

  
319
            //SetText();
320 318
        }
321 319
        #endregion Internal Method
322 320

  
......
359 357
            return rectPathGeometry;
360 358
        }
361 359

  
362
        public static PathGeometry Generate(List<Point> pData)
360
        public static PathGeometry Generate(List<Point> pData, double _ArcLength = 20)
363 361
        {
364 362
            var _pathGeometry = new PathGeometry();
365 363
            double area = MathSet.AreaOf(pData);
......
367 365
            int count = pData.Count;
368 366
            for (int i = 0; i < count; i++)
369 367
            {
370
                PathFigure pathFigure = Polygon.CloudControl.GenerateLineWithCloud(pData[i % count], pData[(i + 1) % count], 20, reverse);
368
                PathFigure pathFigure = Polygon.CloudControl.GenerateLineWithCloud(pData[i % count], pData[(i + 1) % count], _ArcLength, reverse);
371 369
                pathFigure.IsClosed = false;
372 370
                pathFigure.IsFilled = true;
373 371
                _pathGeometry.Figures.Add(pathFigure);
......
396 394

  
397 395
            return _pathGeometry;
398 396
        }
399

  
400
        //public static PathFigure GenerateLineWithCloud(Point p1, Point p2, double _arcLength, bool reverse)
401
        //{
402
        //    PathFigure pathFigure = new PathFigure();
403
        //    pathFigure.StartPoint = p1;
404

  
405
        //    double arcLength = _arcLength;
406
        //    double dx = p2.X - p1.X;
407
        //    double dy = p2.Y - p1.Y;
408
        //    double l = MathSet.DistanceTo(p1, p2);
409
        //    double theta = Math.Atan2(Math.Abs(dy), Math.Abs(dx)) * 180 / Math.PI;
410
        //    Point lastPt = new Point(p1.X, p1.Y);
411
        //    double count = l / _arcLength;
412

  
413
        //    dx /= l;
414
        //    dy /= l;
415

  
416
        //    Double j = 1;
417
        //    for (j = 1; j < (count - 1); j++)
418
        //    {
419
        //        ArcSegment arcSeg = new ArcSegment();
420
        //        arcSeg.Size = new Size(arcLength * TextControl._CloudArcDepth, arcLength * TextControl._CloudArcDepth);
421
        //        arcSeg.Point = new Point(p1.X + j * dx * arcLength, p1.Y + j * dy * arcLength);
422
        //        lastPt = arcSeg.Point;
423
        //        arcSeg.RotationAngle = theta + 90;
424
        //        if (true == reverse)
425
        //            arcSeg.SweepDirection = SweepDirection.Clockwise;
426
        //        pathFigure.Segments.Add(arcSeg);
427
        //    }
428

  
429
        //    if ((count > j) || count > 0)
430
        //    {
431
        //        arcLength = MathSet.DistanceTo(lastPt, p2);
432
        //        ArcSegment arcSeg = new ArcSegment();
433
        //        arcSeg.Size = new Size(arcLength * TextControl._CloudArcDepth, arcLength * TextControl._CloudArcDepth);
434
        //        arcSeg.Point = new Point(p2.X, p2.Y);
435
        //        arcSeg.RotationAngle = theta;
436

  
437
        //        if (true == reverse)
438
        //            arcSeg.SweepDirection = SweepDirection.Clockwise;
439

  
440
        //        pathFigure.Segments.Add(arcSeg);
441

  
442
        //    }
443
        //    return pathFigure;
444
        //}
445 397
        #endregion
446 398

  
447 399
        #region Dependency Properties
......
472 424
        public static readonly DependencyProperty StrokeColorProperty = DependencyProperty.Register(
473 425
            "StrokeColor", typeof(SolidColorBrush), typeof(TextControl), new PropertyMetadata(new SolidColorBrush(Colors.Red)));
474 426

  
427
        public static readonly DependencyProperty ArcLengthProperty = DependencyProperty.Register(
428
            "ArcLength", typeof(double), typeof(TextControl), new PropertyMetadata((Double)10, PointValueChanged));
429

  
475 430
        //강인구 추가
476 431
        public static readonly DependencyProperty IsHighlightProperty = DependencyProperty.Register(
477 432
            "IsHighLight", typeof(bool), typeof(TextControl), new PropertyMetadata(false, PointValueChanged));
......
494 449
        public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register(
495 450
            "PathData", typeof(Geometry), typeof(TextControl), null);
496 451

  
497

  
498

  
499 452
        public static readonly DependencyProperty PathDataInnerProperty = DependencyProperty.Register(
500
    "PathDataInner", typeof(Geometry), typeof(TextControl), null);
453
            "PathDataInner", typeof(Geometry), typeof(TextControl), null);
501 454

  
502 455
        public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register(
503 456
            "OverViewPathDataProperty", typeof(Geometry), typeof(TextControl), null);
......
525 478
            "CanvasY", typeof(double), typeof(TextControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
526 479

  
527 480
        public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register(
528
              "StartPoint", typeof(Point), typeof(TextControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
481
            "StartPoint", typeof(Point), typeof(TextControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
529 482

  
530 483
        public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register(
531
             "EndPoint", typeof(Point), typeof(TextControl), new PropertyMetadata(new Point(100, 100), PointValueChanged));
484
            "EndPoint", typeof(Point), typeof(TextControl), new PropertyMetadata(new Point(100, 100), PointValueChanged));
532 485

  
533 486
        public static readonly DependencyProperty TextSizeProperty = DependencyProperty.Register(
534
               "TextSize", typeof(Double), typeof(TextControl), new PropertyMetadata((Double)30, PointValueChanged));
487
            "TextSize", typeof(Double), typeof(TextControl), new PropertyMetadata((Double)30, PointValueChanged));
535 488

  
536 489
        public static readonly DependencyProperty PaintProperty = DependencyProperty.Register(
537
                "Paint", typeof(PaintSet), typeof(TextControl), new PropertyMetadata((PaintSet.None), PointValueChanged));
490
            "Paint", typeof(PaintSet), typeof(TextControl), new PropertyMetadata((PaintSet.None), PointValueChanged));
538 491

  
539 492
        public static readonly DependencyProperty OverViewPaintProperty = DependencyProperty.Register(
540
                "OverViewPaint", typeof(PaintSet), typeof(TextControl), new PropertyMetadata((PaintSet.None), PointValueChanged));
493
            "OverViewPaint", typeof(PaintSet), typeof(TextControl), new PropertyMetadata((PaintSet.None), PointValueChanged));
541 494

  
542 495
        public static readonly DependencyProperty AngleProperty = DependencyProperty.Register(
543 496
            "Angle", typeof(double), typeof(TextControl), new PropertyMetadata((double)0.0, new PropertyChangedCallback(AngleValueChanged)));
......
546 499
           "EnableEditing", typeof(bool), typeof(TextControl), new PropertyMetadata((true), new PropertyChangedCallback(OnIsEditingChanged)));
547 500

  
548 501
        public static readonly DependencyProperty TextBoxVisibilityProperty = DependencyProperty.Register(
549
        "TextBoxVisibility", typeof(Visibility), typeof(TextControl), new PropertyMetadata((Visibility.Visible), OnTextBoxVisibilityChanged));
502
            "TextBoxVisibility", typeof(Visibility), typeof(TextControl), new PropertyMetadata((Visibility.Visible), OnTextBoxVisibilityChanged));
550 503

  
551 504
        public static readonly DependencyProperty TextBlockVisibilityProperty = DependencyProperty.Register(
552
        "TextBlockVisibility", typeof(Visibility), typeof(TextControl), new PropertyMetadata((Visibility.Collapsed), OnTextBlockVisibilityChanged));
505
            "TextBlockVisibility", typeof(Visibility), typeof(TextControl), new PropertyMetadata((Visibility.Collapsed), OnTextBlockVisibilityChanged));
553 506

  
554 507
        #endregion Dependency Properties
555 508

  
......
568 521
            }
569 522
        }
570 523

  
571

  
524
        public Double ArcLength
525
        {
526
            get { return (Double)GetValue(ArcLengthProperty); }
527
            set
528
            {
529
                if (this.ArcLength != value)
530
                {
531
                    SetValue(ArcLengthProperty, value);
532
                    OnPropertyChanged("ArcLength");
533
                }
534
            }
535
        }
572 536

  
573 537
        public bool EnableEditing
574 538
        {

내보내기 Unified diff

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