프로젝트

일반

사용자정보

개정판 4804a4fb

ID4804a4fb9474afcd10ce2b091ff16f01264ebae4
상위 2dfbf711
하위 836132c4

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

issue #937: line size 계산 로직 수정, 텍스트가 뒤집혀 나오는 현상 수정, arc length 계산 로직 추가

Change-Id: I74b1e59bd6f2983c8cc107ea34654ecf791fc470

차이점 보기:

FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/DrawSet_Cloud.cs
22 22
        public static void GenerateLineWithCloud(Point p1, Point p2, double arcLength, PdfContentByte contentByte)
23 23
        {
24 24
            double l = MathSet.DistanceTo(p1, p2); /// p1와 p2의 길이
25
            arcLength = arcLength * 72 / 96 * 0.4;
26 25
            if (l > 0)
27 26
            {
28 27
                arcLength = (l < arcLength) ? l : arcLength;
......
74 73
            contentByte.SetColorStroke(bs);
75 74
            List<float> DashSet = new List<float>();
76 75

  
77
            /// WPF defines a device-independent pixel as 1 / 96 per inch
78
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
79
            lineSize = lineSize * 72 / 96*0.5;
80

  
81 76
            DashSize.ToList().ForEach(data => DashSet.Add((float)data * 2));
82 77
            contentByte.SetLineDash(DashSet.ToArray(), DashSet.Count - 2);
83 78
            contentByte.SetLineWidth((float)lineSize);
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Arc.cs
21 21
            BaseColor bs = new BaseColor(color.Color.R, color.Color.G, color.Color.B, color.Color.A);
22 22
            contentByte.SetColorStroke(bs);
23 23

  
24
            lineSize = lineSize * 72 / 96;
25 24
            contentByte.SetLineWidth((float)lineSize);
26
            //contentByte.SetLineWidth((float)lineSize - 2);
27 25
            contentByte.NewPath();
28 26
            contentByte.MoveTo((float)p1.X, (float)p1.Y);
29 27

  
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Arrow.cs
24 24
                BaseColor bs = new BaseColor(color.Color.R, color.Color.G, color.Color.B, color.Color.A);
25 25
                contentByte.SetColorFill(bs);
26 26
                contentByte.SetColorStroke(bs);
27
                lineSize = lineSize * 72 / 96 * 0.5;
28 27
                contentByte.SetLineWidth(lineSize);
29 28

  
30 29
                double l = MathSet.DistanceTo(p1, p2);
......
34 33

  
35 34
                contentByte.NewPath();
36 35

  
37
                contentByte.MoveTo(p1.X - dx * 3 - norm.X * 1, p1.Y - dy * 3 - norm.Y * 1);
38
                contentByte.LineTo(p1.X - dx * 3 + norm.X * 1, p1.Y - dy * 3 + norm.Y * 1);
36
                contentByte.MoveTo(p1.X - dx * 3*lineSize - norm.X * 1*lineSize, p1.Y - dy * 3*lineSize - norm.Y * 1*lineSize);
37
                contentByte.LineTo(p1.X - dx * 3*lineSize + norm.X * 1*lineSize, p1.Y - dy * 3*lineSize + norm.Y * 1*lineSize);
39 38
                contentByte.LineTo(p1.X, p1.Y);
40
                contentByte.LineTo(p1.X - dx * 3 - norm.X * 1, p1.Y - dy * 3 - norm.Y * 1);
39
                contentByte.LineTo(p1.X - dx * 3*lineSize - norm.X * 1*lineSize, p1.Y - dy * 3*lineSize - norm.Y * 1*lineSize);
41 40

  
42 41
                contentByte.ClosePathFillStroke();
43 42
            }
44 43
            contentByte.RestoreState();
45 44
        }
46 45

  
47
        public static void ConverseAllow(System.Windows.Point p2, System.Windows.Point p1, int lineSize, PdfContentByte contentByte,
48
                                            SolidColorBrush color, double opac, bool isFixPoint = false)
49
        {
50
            contentByte.SaveState();
51
            PdfGState gs1 = new PdfGState();
52
            gs1.StrokeOpacity = (float)opac;
53
            contentByte.SetGState(gs1);
54
            var rect = contentByte.PdfDocument.PageSize;
55
            BaseColor bs = new BaseColor(color.Color.R, color.Color.G, color.Color.B, color.Color.A);
56
            contentByte.SetColorFill(bs);
57
            contentByte.SetColorStroke(bs);
58

  
59
            contentByte.SetLineWidth((float)lineSize);
60
            if (isFixPoint)
61
            {
62
                var temp = p1;
63
                p1 = p2;
64
                p2 = temp;
65
            }
66
            double theta = Math.Atan2((p1.Y - p2.Y), (p1.X - p2.X)) * 180 / Math.PI;
67
            iTextSharp.awt.geom.Point startPoint = new iTextSharp.awt.geom.Point(p1.X, p1.Y);
68
            //iTextSharp.awt.geom.Point leftPoint = new iTextSharp.awt.geom.Point(p1.X + lineSize * 2 / 3.0, p1.Y + lineSize * 4 / 3.0);
69
            //iTextSharp.awt.geom.Point rightPoint = new iTextSharp.awt.geom.Point(p1.X - lineSize * 2 / 3.0, p1.Y + lineSize * 4 / 3.0);
70

  
71
            iTextSharp.awt.geom.Point leftPoint = new iTextSharp.awt.geom.Point(p1.X + lineSize * 1, p1.Y + lineSize *2);
72
            iTextSharp.awt.geom.Point rightPoint = new iTextSharp.awt.geom.Point(p1.X - lineSize * 1, p1.Y + lineSize *2);
73

  
74

  
75
            iTextSharp.awt.geom.Point rotateP1left = RotateAbout(startPoint, leftPoint, theta - 270);
76
            iTextSharp.awt.geom.Point rotateP1right = RotateAbout(startPoint, rightPoint, theta - 270);
77

  
78
            contentByte.NewPath();
79

  
80

  
81
            if (p1.X > p2.X)
82
            {
83
                contentByte.MoveTo((float)startPoint.x - 1.5, (float)startPoint.y);
84
            }
85
            else
86
            {
87
                contentByte.MoveTo((float)startPoint.x + 1.5, (float)startPoint.y);
88
            }
89
            //contentByte.MoveTo((float)startPoint.x, (float)startPoint.y);
90

  
91
            contentByte.LineTo((float)rotateP1left.x, (float)rotateP1left.y);
92
            contentByte.LineTo((float)rotateP1right.x, (float)rotateP1right.y);
93

  
94
            contentByte.ClosePathFillStroke();
95
            contentByte.RestoreState();
96
        }
97

  
98 46
        public static void DimAllow(System.Windows.Point p1, System.Windows.Point p2, int lineSize, PdfContentByte contentByte,
99 47
                                        SolidColorBrush color, double opac, bool isFixPoint = false)
100 48
        {
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_DrawString.cs
12 12
{
13 13
    public partial class HoneyPDFLib_DrawSet_Text
14 14
    {
15
        const double MARGIN = 1.5;  /// it's magic number
15
        const double MARGIN = 1.25;  /// it's magic number
16 16

  
17 17
        private static iTextSharp.text.Font CreateFont(FontStyle fontstyle, FontWeight fontweight, TextDecorationCollection isUnderline, Rectangle rect, string text)
18 18
        {
......
66 66
            };
67 67

  
68 68
            var calRect = MathSet.GetPointsToRectX(points);
69
            if(lineSize*2 > calRect.Height) lineSize *= 0.3;    /// 텍스트가 뒤집어 지는것 방지
69 70
            if (calRect.Top > calRect.Bottom)
70 71
            {
71 72
                calRect.Left += (float)lineSize;
......
81 82
                calRect.Bottom -= (float)lineSize;
82 83
            }
83 84

  
84
            lineSize = lineSize * 72 / 96 * 0.5;
85 85
            contentByte.SetLineWidth((float)lineSize);
86 86

  
87 87
            System.Drawing.Drawing2D.Matrix mat = new System.Drawing.Drawing2D.Matrix();
......
101 101

  
102 102
            if ((PaintStyle & PaintSet.Hatch) == PaintSet.Hatch)
103 103
            {
104
                double ArcLength = 10;  /// default arc length
104
                /// default arc length
105
                double ArcLength = 10/(MarkupToPDF.scaleWidth > MarkupToPDF.scaleHeight ? MarkupToPDF.scaleWidth : MarkupToPDF.scaleHeight);
105 106

  
106 107
                DrawSet_Cloud.DrawCloud(transformed, lineSize, ArcLength, contentByte, new DoubleCollection(99999), color, new SolidColorBrush(Color.FromRgb(255, 255, 255)), (PaintStyle & ~PaintSet.Hatch) | PaintSet.Fill, 0.7);
107 108

  
......
142 143
            ct.SetText(new Phrase(new Chunk(text, itextFont)));
143 144
            ct.Alignment = Element.ALIGN_MIDDLE | Element.ALIGN_CENTER;
144 145
            float fLeadingSize = (calRect.Height / (float)tokens.Length);
145
            ct.SetLeading(itextFont.CalculatedSize + 1, ct.MultipliedLeading);
146
            float spacing = ((float)calRect.Height - tokens.Length*itextFont.CalculatedSize)/tokens.Length;
147
            ct.SetLeading(itextFont.CalculatedSize + spacing, ct.MultipliedLeading);
146 148
            /// expand size of rectangle to prevent text disappear
147 149
            calRect.Right += itextFont.CalculatedSize;
148 150

  
149 151
            if (calRect.Top > calRect.Bottom)
150 152
            {
151
                float top = calRect.Bottom + (tokens.Length - 1) * (itextFont.CalculatedSize + 1) + itextFont.CalculatedSize + (float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
153
                float top = calRect.Bottom + (tokens.Length - 1) * (itextFont.CalculatedSize + spacing) + itextFont.CalculatedSize*(float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
152 154
                calRect.Top = top < calRect.Top ? calRect.Top : top;
153 155
            }
154 156
            else
155 157
            {
156
                float bottom = calRect.Top + (tokens.Length - 1) * (itextFont.CalculatedSize + 1) + itextFont.CalculatedSize + (float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
158
                float bottom = calRect.Top + (tokens.Length - 1) * (itextFont.CalculatedSize + spacing) + itextFont.CalculatedSize*(float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
157 159
                calRect.Bottom = bottom < calRect.Bottom ? calRect.Bottom : bottom;
158 160
            }
159 161
            /// up to here
......
178 180
            points.Add(rect.BottomRight);
179 181
            points.Add(rect.TopRight);
180 182

  
181
            lineSize = lineSize * 72 / 96*0.5;
182 183
            contentByte.SetLineWidth((float)lineSize);
183 184

  
184 185
            System.Drawing.Drawing2D.Matrix mat = new System.Drawing.Drawing2D.Matrix();
......
198 199

  
199 200
            if ((PaintStyle & PaintSet.Hatch) == PaintSet.Hatch)
200 201
            {
201
                double ArcLength = 10;  /// default arc length
202
                /// default arc length
203
                double ArcLength = 10 / (MarkupToPDF.scaleWidth > MarkupToPDF.scaleHeight ? MarkupToPDF.scaleWidth : MarkupToPDF.scaleHeight);
202 204

  
203 205
                DrawSet_Cloud.DrawCloud(transformed, lineSize, ArcLength, contentByte, new DoubleCollection(99999), color, new SolidColorBrush(Color.FromRgb(255, 255, 255)), (PaintStyle & ~PaintSet.Hatch) | PaintSet.Fill, 0.7);
204 206

  
......
214 216
            }
215 217

  
216 218
            var calRect = MathSet.GetPointsToRectX(points);
219
            if (lineSize * 2 > calRect.Height) lineSize *= 0.3;    /// 텍스트가 뒤집어 지는것 방지
217 220
            /// calculate text area except border
218 221
            if (calRect.Top > calRect.Bottom)
219 222
            {
......
245 248
                text = text.Remove(0, 1);
246 249
            }
247 250

  
251
            string[] tokens = text.Split(Environment.NewLine.ToArray(), StringSplitOptions.RemoveEmptyEntries);
248 252
            ct.Canvas.Transform(mat);
249 253
            ct.Canvas.SetGState(gs3);
250 254
            ct.SetText(new Phrase(new Chunk(text, itextFont)));
251 255
            ct.Alignment = Element.ALIGN_MIDDLE | Element.ALIGN_CENTER;
252
            ct.SetLeading(itextFont.CalculatedSize + 1, ct.MultipliedLeading);
256
            float spacing = ((float)calRect.Height - tokens.Length * itextFont.CalculatedSize) / tokens.Length;
257
            ct.SetLeading(itextFont.CalculatedSize + spacing, ct.MultipliedLeading);
253 258
            /// expand size of rectangle to prevent text disappear
254 259
            calRect.Right += itextFont.CalculatedSize;
255
            string[] tokens = text.Split(Environment.NewLine.ToArray(), StringSplitOptions.RemoveEmptyEntries);
256 260
            if (calRect.Top > calRect.Bottom)
257 261
            {
258
                float top = calRect.Bottom + (tokens.Length - 1) * (itextFont.CalculatedSize + 1) + itextFont.CalculatedSize + (float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
262
                float top = calRect.Bottom + (tokens.Length - 1) * (itextFont.CalculatedSize + spacing) + itextFont.CalculatedSize*(float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
259 263
                calRect.Top = top < calRect.Top ? calRect.Top : top;
260 264
            }
261 265
            else
262 266
            {
263
                float bottom = calRect.Top + (tokens.Length - 1) * (itextFont.CalculatedSize + 1) + itextFont.CalculatedSize + (float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
267
                float bottom = calRect.Top + (tokens.Length - 1) * (itextFont.CalculatedSize + spacing) + itextFont.CalculatedSize*(float)HoneyPDFLib_DrawSet_Text.MARGIN; ;
264 268
                calRect.Bottom = bottom < calRect.Bottom ? calRect.Bottom : bottom;
265 269
            }
266 270
            /// up to here
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Line.cs
29 29
                contentByte.SetLineDash(DashSet.ToArray(), DashSet.Count - 2);
30 30
            }
31 31

  
32
            /// WPF defines a device-independent pixel as 1 / 96 per inch
33
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
34
            lineSize = lineSize * 72 / 96 * 0.5;
35 32
            contentByte.SetLineWidth((float)lineSize);
36 33
            contentByte.MoveTo((float)startP.X, (float)startP.Y);
37 34
            contentByte.LineTo((float)endP.X, (float)endP.Y);
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Shape.cs
31 31
                contentByte.SetLineDash(DashSet.ToArray(), DashSet.Count - 2);
32 32
            }
33 33

  
34
            /// WPF defines a device-independent pixel as 1 / 96 per inch
35
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
36
            lineSize = lineSize * 72 / 96*0.5;
37

  
38 34
            contentByte.SetLineWidth((float)lineSize);
39 35
            contentByte.NewPath();
40 36
            contentByte.MoveTo((float)points.First().X, (float)points.First().Y);
......
77 73
                contentByte.SetLineDash(DashSet.ToArray(), DashSet.Count - 2);
78 74
            }
79 75

  
80
            /// WPF defines a device-independent pixel as 1 / 96 per inch
81
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
82
            lineSize = lineSize * 72 / 96*0.5;
83

  
84 76
            contentByte.SetLineWidth((float)lineSize);
85 77

  
86 78
            contentByte.NewPath();
......
123 115
                contentByte.SetLineDash(DashSet.ToArray(), DashSet.Count - 2);
124 116
            }
125 117

  
126
            /// WPF defines a device-independent pixel as 1 / 96 per inch
127
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
128
            lineSize = lineSize * 72 / 96*0.5;
129 118
            contentByte.SetLineWidth((float)lineSize);
130 119

  
131 120
            contentByte.NewPath();
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
333 333
        #endregion
334 334

  
335 335
        #region PDF
336
        float scaleWidth = 0;
337
        float scaleHeight = 0;
338

  
336
        public static float scaleWidth = 0;
337
        public static float scaleHeight = 0;
339 338
         
340 339
        private string SetFlattingPDF(string tempFileInfo)
341 340
        {
......
496 495
                            
497 496
                            foreach (var data in markedData)
498 497
                            {
499
                                
500 498
                                var item = JsonSerializerHelper.UnCompressString(data);
501
                                //item = data.Replace("H", "_h");
502 499
                                var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
503 500

  
504 501
                                try
......
519 516
                                                    var Opacity = control.Opac;
520 517
                                                    string UserID = control.UserID;
521 518
                                                    double Interval = control.Interval;
522
                                                    double LineSize = Convert.ToDouble(InnerData.First());
519
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
523 520
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
524 521
                                                    switch (control.LineStyleSet)
525 522
                                                    {
526
                                                        //case LineStyleSet.SingleLine:
527
                                                        //    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
528
                                                        //    break;
529 523
                                                        case LineStyleSet.ArrowLine:
530
                                                            //Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
531 524
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
532 525
                                                            break;
533 526
                                                        case LineStyleSet.CancelLine:
......
546 539
                                                        case LineStyleSet.TwinLine:
547 540
                                                            {
548 541
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
549
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.ConverseAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
550
                                                                //Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
542
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
551 543
                                                            }
552 544
                                                            break;
553 545
                                                        case LineStyleSet.DimLine:
554 546
                                                            {
555 547
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.DimAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
556 548
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
557
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.ConverseAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
549
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
558 550
                                                            }
559 551
                                                            break;
560 552
                                                        default:
......
577 569
                                                    Point EndPoint = GetPdfPointSystem(control.EndPoint);
578 570
                                                    DoubleCollection DashSize = control.DashSize;
579 571
                                                    List<Point> PointSet = GetPdfPointSystem(control.PointSet);
580
                                                    double LineSize = Convert.ToDouble(InnerData.First());
572
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
581 573

  
582 574
                                                    double Opacity = control.Opac;
583 575

  
......
604 596
                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
605 597
                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
606 598
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
607
                                                double LineSize = Convert.ToDouble(InnerData.First());
599
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
608 600
                                                double Opacity = control.Opac;
609 601
                                                DoubleCollection DashSize = control.DashSize;
610 602

  
......
626 618

  
627 619
                                                    var Opacity = control.Opac;
628 620
                                                    string UserID = control.UserID;
629
                                                    double LineSize = Convert.ToDouble(InnerData.First());
621
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
630 622
                                                    bool IsTransOn = control.IsTransOn;
631 623

  
632 624
                                                    if (control.IsTransOn)
633 625
                                                    {
634 626
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
635
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.ConverseAllow(EndPoint, MidPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
627
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
636 628
                                                    }
637 629
                                                    else
638 630
                                                    {
......
648 640
                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
649 641
                                        {
650 642
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
651
                                                double LineSize = Convert.ToDouble(data2.First());
643
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
652 644
                                                var PaintStyle = control.PaintState;
653 645
                                                double Angle = control.Angle;
654 646
                                                DoubleCollection DashSize = control.DashSize;
......
664 656
                                        using (S_TriControl control  = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
665 657
                                        {
666 658
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
667
                                                double LineSize = Convert.ToDouble(data2.First());
659
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
668 660
                                                var PaintStyle = control.Paint;
669 661
                                                double Angle = control.Angle;
670 662
                                                //StrokeColor = _SetColor, //색상은 레드
......
681 673
                                            using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
682 674
                                            {
683 675
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
684
                                                double LineSize = Convert.ToDouble(data2.First());
676
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
685 677
                                                var StartPoint = GetPdfPointSystem(control.StartPoint);
686 678
                                                var EndPoint = GetPdfPointSystem(control.EndPoint);
687 679
                                                var PaintStyle = control.PaintState;
......
699 691
                                            using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
700 692
                                            {
701 693
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
702
                                                double LineSize = Convert.ToDouble(data2.First());
694
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
703 695
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
704
                                                //double ArcLength = 30;
705 696
                                                double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
706 697

  
707

  
708
                                                double ArcLength = control.ArcLength == 0 ? 10 : control.ArcLength;
698
                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength)/(scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
709 699

  
710 700
                                                var PaintStyle = control.PaintState;
711 701
                                                double Opacity = control.Opac;
......
732 722
                                            using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
733 723
                                            {
734 724
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
735
                                                double LineSize = Convert.ToDouble(data2.First());
725
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
736 726
                                                double Toler = control.Toler;
737 727
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
738
                                                double ArcLength = control.ArcLength == 0 ? 10 : control.ArcLength;
728
                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength)/(scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
739 729
                                                var PaintStyle = control.PaintState;
740 730
                                                double Opacity = control.Opac;
741 731
                                                bool isTransOn = control.IsTrans;
......
807 797
                                                }
808 798
                                                if (control.isHighLight) paint |= PaintSet.Highlight;
809 799

  
810
                                                double LineSize = Convert.ToDouble(data2.First());
800
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
811 801
                                                double TextSize = Convert.ToDouble(data2[1]);
812 802
                                                SolidColorBrush FontColor = _SetColor;
813 803
                                                double Angle = control.Angle;
......
837 827
                                                    decoration = TextDecorations.Underline;
838 828
                                                }
839 829

  
840
                                                if (LineSize <= 3)
841
                                                {
842
                                                    LineSize = 3;
843
                                                }
844

  
845 830
                                                Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, _SetColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
846 831
                                            }
847 832
                                            break;
......
873 858
                                                var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
874 859
                                                var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
875 860

  
876
                                                double LineSize = Convert.ToDouble(data2.First());
861
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
877 862
                                                SolidColorBrush FontColor = _SetColor;
878 863
                                                bool isHighlight = control.isHighLight;
879 864
                                                double Opacity = control.Opac;
......
983 968
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), 
984 969
                                                            newStartPoint, newMidPoint,
985 970
                                                            LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, new FontFamily(), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
986

  
987

  
988 971
                                                        }
989
                                                }
990

  
972
                                                    }
991 973
                                                }
992 974
                                                catch (Exception ex)
993 975
                                                {
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.csproj
88 88
  </ItemGroup>
89 89
  <ItemGroup>
90 90
    <Compile Include="Common\CommentUserInfo.cs" />
91
    <Compile Include="Common\ConverterLineSize.cs" />
91 92
    <Compile Include="Common\DataController.cs" />
92 93
    <Compile Include="Common\GetUserSign.cs" />
93 94
    <Compile Include="Common\StringToFont.cs" />
KCOM/KCOM.csproj.user
8 8
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQyIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJhZG1pbiIsIk1vZGUiOjB9</StartArguments>
9 9
  </PropertyGroup>
10 10
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
11
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMDU3IiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJIMjAxMTM1NyIsIk1vZGUiOjB9</StartArguments>
11
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQwIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJIMjAxMTM1NyIsIk1vZGUiOjB9</StartArguments>
12 12
    <StartAction>Project</StartAction>
13 13
  </PropertyGroup>
14 14
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
KCOM/Views/MainMenu.xaml.cs
2313 2313
                            break;
2314 2314
                        case ControlType.PolygonControl:
2315 2315
                            {
2316

  
2317 2316
                                var control = currentControl as PolygonControl;
2318 2317

  
2319 2318
                                if (control != null)
......
2866 2865

  
2867 2866
        }
2868 2867

  
2868
        /// <summary>
2869
        /// select items by dragging
2870
        /// </summary>
2869 2871
        private void ApplyDragSelectionRect()
2870 2872
        {
2871 2873
            multi_Undo_Data = new Multi_Undo_data();
......
3005 3007
            }
3006 3008
        }
3007 3009

  
3008
        public bool IsSelectionControl(Rect dragRect, Rect controlRect, Geometry OverViewPathData, ControlType type)
3009
        {
3010
            //// X, Y, WIDTH, HEIGHT 형태로 RECT를 만든다.
3011

  
3012
            bool result = false;
3013
            if (dragRect.Contains(controlRect))
3014
            {
3015
                result = true;
3016
                //잡은 객체들을 담은 리스트
3017
                try
3018
                {
3019
                    selected_item.Add(OverViewPathData, type.ToString());
3020
                }
3021
                catch (Exception)
3022
                {
3023

  
3024
                }
3025
            }
3026
            return result;
3027
        }
3028

  
3029 3010
        private void drawingPannelRotate(double angle)
3030 3011
        {
3031 3012
            Logger.sendCheckLog("pageNavigator_PageChanging_drawingPannelRotate Setting", 1);
......
4841 4822
                                    control.LineSize = ViewerDataModel.Instance.LineSize;
4842 4823
                                    control.PointSet.Add(firstPoint);
4843 4824

  
4844
                                    ///control.SetPolyPath();
4845

  
4846 4825
                                    control.ApplyOverViewData();
4847 4826

  
4848 4827
                                    CreateControl();
......
4863 4842
                                    currentControl.CommentID = Commons.shortGuid();
4864 4843
                                    currentControl.IsNew = true;
4865 4844
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
4866
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
4867
                                    //currentControl.OnApplyTemplate();
4845
                                    polygonControl.StartPoint = canvasDrawingMouseDownPoint;
4846
                                    polygonControl.EndPoint = canvasDrawingMouseDownPoint;
4868 4847
                                    polygonControl.PointSet.Add(canvasDrawingMouseDownPoint);
4869 4848
                                    polygonControl.PointSet.Add(canvasDrawingMouseDownPoint);
4849
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
4870 4850
                                    polygonControl.ApplyTemplate();
4871 4851
                                    polygonControl.Visibility = Visibility.Visible;
4872 4852
                                }
MarkupToPDF/Controls/Polygon/PolygonControl.cs
419 419

  
420 420
        public void updateControl()
421 421
        {
422
            //this.PointSet = new List<Point>();
423

  
424
            //this.PointSet.Clear();
425

  
426
            //this.PointSet.AddRange(PointC.pointSet);
427
            //this.PointSet.AddRange(PointSet);
428

  
429 422
            this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y);
430

  
431 423
            this.EndPoint = new Point(this.PointSet[this.PointSet.Count - 1].X, this.PointSet[this.PointSet.Count - 1].Y);
432 424

  
433 425
            SetPolyPath();
......
445 437

  
446 438
                PathGeometry pathGeometry = new PathGeometry();
447 439
                PathFigure pathFigure = new PathFigure();
448
                PolyLineSegment instance = new PolyLineSegment();
449
                foreach (var Inneritem in PointSet)
450
                {
451
                    instance.Points.Add(Inneritem);
452
                }
440
                PolyLineSegment instance = new PolyLineSegment(this.PointSet, true);
453 441
               
454 442
                StartPoint = instance.Points.First();
455 443
                pathFigure.StartPoint = StartPoint;
......
464 452
                    {
465 453
                        case PaintSet.None:
466 454
                            {
455
                                pathFigure.IsFilled = false;
467 456
                                //강인구 추가
468 457
                                Base_PolyPath.Fill = null;
469 458
                            }
......
484 473
                }
485 474

  
486 475
                this.PathData = pathGeometry;
487
                this.OverViewPathData = PathData;
476
                this.ApplyOverViewData();
488 477
            }
489 478
        }
490 479

  
......
584 573
                    PointSet = s.PointSet,
585 574
                    UserID = s.UserID,
586 575
                    Paint = s.PaintState,
587
                    //PointC = s.PointC,
588 576
                    Memo = s.Memo
589 577
                };
590 578
            }
591 579
        }
592
        //public PaintSet Paint { get; set; }
593 580

  
594 581

  
595 582
        #region Dispose
MarkupToPDF/MarkupToPDF.csproj.user
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 3
  <PropertyGroup>
4
    <ProjectView>ShowAllFiles</ProjectView>
4
    <ProjectView>ProjectFiles</ProjectView>
5 5
  </PropertyGroup>
6 6
</Project>

내보내기 Unified diff

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