프로젝트

일반

사용자정보

개정판 ca7b7b56

IDca7b7b5665847bfdc6475332695fc03547e340dd
상위 f48bd1c5
하위 702651f1

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

Fix: RectCloudControl, RectangleControl에서 AxisLock이 설정되어 있으면 혹은 Shift Key를 누르면 크기를 정비율로 수정되도록 수정

Change-Id: I2322ed0d4a252b7f98893ac2fcf5cca6b2fddd18

차이점 보기:

MarkupToPDF/Controls/Shape/RectCloudControl.cs
608 608
                }
609 609
            }
610 610

  
611
            var ReverseP = (i + path.PointSet.Count() / 2) % path.PointSet.Count();
612
            var PreviousP = (i + (path.PointSet.Count() - 1)) % path.PointSet.Count();
613
            var NextP = (i + 1) % path.PointSet.Count();
614

  
615
            var distance = MathSet.DistanceTo(path.PointSet[ReverseP], path.PointSet[i]);
616

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

  
623
            var NextV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[NextP]);
624
            l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, path.PointSet
625
                [i].Y - path.PointSet[ReverseP].Y);
626
            path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l);
611
            var OppositeP = (i + path.PointSet.Count / 2) % path.PointSet.Count;
612
            var PreviousP = (i + (path.PointSet.Count - 1)) % path.PointSet.Count;
613
            var NextP = (i + 1) % path.PointSet.Count;
614

  
615
            if (bAxisLocked)
616
            {
617
                double _dx = path.PointSet[i].X - path.PointSet[OppositeP].X;
618
                double _dy = path.PointSet[i].Y - path.PointSet[OppositeP].Y;
619
                double distance = Math.Max(Math.Abs(_dx), Math.Abs(_dy));
620

  
621
                var PreviousV = path.PointSet[PreviousP] - path.PointSet[OppositeP];
622
                PreviousV.Normalize();
623
                path.PointSet[PreviousP] = path.PointSet[OppositeP] + PreviousV * distance;
624

  
625
                var NextV = path.PointSet[NextP] - path.PointSet[OppositeP];
626
                NextV.Normalize();
627
                path.PointSet[NextP] = path.PointSet[OppositeP] + NextV * distance;
628

  
629
                path.PointSet[i] = path.PointSet[OppositeP] + PreviousV * distance + NextV * distance;
630
            }
631
            else
632
            {
633
                var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[PreviousP]);
634
                var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X,
635
                    path.PointSet[i].Y - path.PointSet[OppositeP].Y);
636
                path.PointSet[PreviousP] = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet
637
                    [OppositeP].Y + PreviousV.Y * l);
638

  
639
                var NextV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[NextP]);
640
                l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, path.PointSet
641
                    [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);
643
            }
627 644

  
628 645
            this.UpdateControl();
629 646
        }

내보내기 Unified diff

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