프로젝트

일반

사용자정보

개정판 56f4174c

ID56f4174c979ca38e51305afe3f712b33fa33c354
상위 efd9be38
하위 1c64244c, 7a3b7ef3

임예철이(가) 9달 전에 추가함

Circle, Rectangle, Cloud Rectangle 좌표곂침 수정

Change-Id: I5e6d6cf2bb256857f5962986565f6611daadc293

차이점 보기:

MarkupToPDF/Controls/Shape/CircleControl.cs
513 513
                var PreviousV = MathSet.GetNormVectorBetween(newPointSet[OppositeP], newPointSet[PreviousP]);
514 514
                var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, newPointSet[i].X - newPointSet[OppositeP].X,
515 515
                    newPointSet[i].Y - newPointSet[OppositeP].Y);
516
                newPointSet[PreviousP] = new Point(newPointSet[OppositeP].X + PreviousV.X * l, newPointSet[OppositeP].Y
516

  
517
                Point pPrevious = new Point(newPointSet[OppositeP].X + PreviousV.X * l, newPointSet[OppositeP].Y
517 518
                    + PreviousV.Y * l);
518 519

  
520
                if (newPointSet.FindAll(x => x.Equals(pPrevious)).Count() == 0)
521
                {
522
                    newPointSet[PreviousP] = pPrevious;
523
                }
524

  
519 525
                var NextV = MathSet.GetNormVectorBetween(newPointSet[OppositeP], newPointSet[NextP]);
520 526
                l = MathSet.DotProduct(NextV.X, NextV.Y, newPointSet[i].X - newPointSet[OppositeP].X, newPointSet[i].Y
521 527
                    - newPointSet[OppositeP].Y);
522
                newPointSet[NextP] = new Point(newPointSet[OppositeP].X + NextV.X * l, newPointSet[OppositeP].Y + NextV.Y * l);
528

  
529
                Point pNext = new Point(newPointSet[OppositeP].X + NextV.X * l, newPointSet[OppositeP].Y + NextV.Y * l);
530

  
531
                if (newPointSet.FindAll(x => x.Equals(pNext)).Count() == 0)
532
                {
533
                    newPointSet[NextP] = pNext;
534
                }
523 535

  
524 536
                path.PointSet = newPointSet;
525 537
            }
MarkupToPDF/Controls/Shape/RectCloudControl.cs
15 15
using MarkupToPDF.Serialize.Core;
16 16
using MarkupToPDF.Serialize.S_Control;
17 17
using System.Linq;
18
using System.ServiceModel.Activation;
18 19

  
19 20
namespace MarkupToPDF.Controls.Shape
20 21
{
......
633 634
                var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[PreviousP]);
634 635
                var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X,
635 636
                    path.PointSet[i].Y - path.PointSet[OppositeP].Y);
636
                path.PointSet[PreviousP] = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet
637

  
638
                Point pPrevious = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet
637 639
                    [OppositeP].Y + PreviousV.Y * l);
638 640

  
641
                if (path.PointSet.FindAll(x => x.Equals(pPrevious)).Count() == 0)
642
                {
643
                    path.PointSet[PreviousP] = pPrevious;
644
                }
645

  
639 646
                var NextV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[NextP]);
640 647
                l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, path.PointSet
641 648
                    [i].Y - path.PointSet[OppositeP].Y);
642
                path.PointSet[NextP] = new Point(path.PointSet[OppositeP].X + NextV.X * l, path.PointSet[OppositeP].Y + NextV.Y * l);
649

  
650
                Point pNext = new Point(path.PointSet[OppositeP].X + NextV.X * l, path.PointSet[OppositeP].Y + NextV.Y * l);
651
                if (path.PointSet.FindAll(x => x.Equals(pNext)).Count() == 0)
652
                {
653
                    path.PointSet[NextP] = pNext;
654
                }
643 655
            }
644 656

  
645 657
            this.UpdateControl();
MarkupToPDF/Controls/Shape/RectangleControl.cs
595 595
                }
596 596
            }
597 597

  
598

  
598 599
            var OppositeP = (i + path.PointSet.Count / 2) % path.PointSet.Count;
599 600
            var PreviousP = (i + (path.PointSet.Count - 1)) % path.PointSet.Count;
600 601
            var NextP = (i + 1) % path.PointSet.Count;
601 602
            if (bAxisLocked)
602 603
            {
603
                double _dx =  path.PointSet[i].X - path.PointSet[OppositeP].X;
604
                double _dy =  path.PointSet[i].Y - path.PointSet[OppositeP].Y;
604
                double _dx = path.PointSet[i].X - path.PointSet[OppositeP].X;
605
                double _dy = path.PointSet[i].Y - path.PointSet[OppositeP].Y;
605 606
                double distance = Math.Max(Math.Abs(_dx), Math.Abs(_dy));
606 607

  
607 608
                var PreviousV = path.PointSet[PreviousP] - path.PointSet[OppositeP];
608 609
                PreviousV.Normalize();
609 610
                path.PointSet[PreviousP] = path.PointSet[OppositeP] + PreviousV * distance;
610 611

  
611
                var NextV = path.PointSet[NextP] -path.PointSet[OppositeP];
612
                var NextV = path.PointSet[NextP] - path.PointSet[OppositeP];
612 613
                NextV.Normalize();
613 614
                path.PointSet[NextP] = path.PointSet[OppositeP] + NextV * distance;
614 615

  
......
619 620
                var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[PreviousP]);
620 621
                var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X,
621 622
                    path.PointSet[i].Y - path.PointSet[OppositeP].Y);
622
                path.PointSet[PreviousP] = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet
623

  
624
                Point pPrevious = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet
623 625
                    [OppositeP].Y + PreviousV.Y * l);
624 626

  
627
                if (path.PointSet.FindAll(x => x.Equals(pPrevious)).Count() == 0)
628
                {
629
                    path.PointSet[PreviousP] = pPrevious;
630
                }
631
                //path.PointSet[PreviousP] = pPrevious;
632

  
625 633
                var NextV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[NextP]);
626 634
                l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, path.PointSet
627 635
                    [i].Y - path.PointSet[OppositeP].Y);
628
                path.PointSet[NextP] = new Point(path.PointSet[OppositeP].X + NextV.X * l, path.PointSet[OppositeP].Y + NextV.Y * l);
636

  
637
                Point pNext = new Point(path.PointSet[OppositeP].X + NextV.X * l, path.PointSet[OppositeP].Y + NextV.Y * l);
638

  
639
                if(path.PointSet.FindAll(x => x.Equals(pNext)).Count() == 0)
640
                {
641
                    path.PointSet[NextP] = pNext;
642
                }
643
                //path.PointSet[NextP] = pNext;
644

  
629 645
            }
630 646

  
631 647
            this.UpdateControl();

내보내기 Unified diff

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