프로젝트

일반

사용자정보

개정판 5a6a5dd1

ID5a6a5dd16606eea61d85d0fb0517fe5aa77e5192
상위 a69467b1
하위 5a9353a9

humkyung 이(가) 6년 이상 전에 추가함

fixed issue #56: 정삼각형을 그릴때 Axis Lock 적용

차이점 보기:

KCOM/Controls/AdornerFinal.xaml.cs
428 428
            AdornerBorder.MinWidth = 10;
429 429
            AdornerBorder.MinHeight = 10;
430 430

  
431
            double minX = 10000;
432
            double minY = 10000;
433
            double maxX = 0;
434
            double maxY = 0;
431
            double minX = double.MaxValue;
432
            double minY = double.MaxValue;
433
            double maxX = double.MinValue;
434
            double maxY = double.MinValue;
435 435

  
436 436
            if (MemberSet.Count == 1)
437 437
            {
......
2116 2116
            //    }
2117 2117
            //}
2118 2118
        }
2119

  
2119 2120
        /// <summary>
2120 2121
        /// 회전
2121 2122
        /// </summary>
......
2123 2124
        /// <param name="e"></param>
2124 2125
        public void rotate_DragDelta(object sender, DragDeltaEventArgs e)
2125 2126
        {
2126
            //DragThumb.Cursor = Cursors.SizeAll;
2127
            //System.Windows.Resources.StreamResourceInfo info = Application.GetResourceStream(new Uri("/KCOM;component/Resources/Images/AdornerImage/sync.cur", UriKind.Relative));
2128
            //rotateTop.Cursor = new System.Windows.Input.Cursor(info.Stream);
2129

  
2130
            //rotateTop.Cursor = new System.Windows.Input.Cursor("../sync.cur");
2131

  
2132
            //if(e.VerticalChange > 10)
2133
            //{
2134
            //    System.Diagnostics.Debug.WriteLine("Width" + ((e.Source as Thumb).Parent as Grid).Width);
2135
            //    System.Diagnostics.Debug.WriteLine("e.HorizontalChange : " + e.HorizontalChange);
2136
            //}
2137

  
2138 2127
            MoveRotate(e);
2139 2128
        }
2140 2129

  
......
2199 2188
            #endregion
2200 2189

  
2201 2190
            //강인구 수정
2202
            AngleValue = AngleValue + dDeltaAngle;
2191
            //AngleValue = AngleValue + dDeltaAngle;
2203 2192
            #endregion
2204 2193

  
2205 2194
            #region 센터 포인트 구하기 (그룹핑)
......
2207 2196
            {
2208 2197
                if (item.DrawingData.GetType().Name == "TextControl")
2209 2198
                {
2199
                    //double X = Canvas.GetLeft((item.DrawingData as TextControl));
2200
                    //double Y = Canvas.GetTop((item.DrawingData as TextControl));
2201
                    //AllPointSet.Add(new Point(X, Y));
2202
                    AllPointSet.Add((item.DrawingData as TextControl).StartPoint);
2210 2203
                }
2211 2204
                else
2212 2205
                {
......
2220 2213
            CenterPoint = MathSet.FindCentroid(AllPointSet);
2221 2214
            Point pt = Mouse.GetPosition(this);
2222 2215

  
2223
            if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl")
2216
            //if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl")
2224 2217
            {
2225 2218
                Point vec1 = new Point(this.rotatePoint.X - CenterPoint.X, this.rotatePoint.Y - CenterPoint.Y);
2226 2219
                Point vec2 = new Point(pt.X - CenterPoint.X, pt.Y - CenterPoint.Y);
2227 2220
                dDeltaAngle = (MathSet.getAngleBetweenVectors(vec1, vec2));
2228 2221
            }
2229
            else
2230
            {
2231
                if (IsTextAngle || RotateFlag)
2232
                {
2233
                    AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle + 5;
2234
                }
2235
                else
2236
                {
2237
                    AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle - 5;
2238
                }
2239
            }
2222
            //else
2223
            //{
2224
            //    //if (IsTextAngle || RotateFlag)
2225
            //    //{
2226
            //    //    AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle + 5;
2227
            //    //}
2228
            //    //else
2229
            //    //{
2230
            //    //    AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle - 5;
2231
            //    //}
2232
            //}
2240 2233

  
2241 2234
            AngleValue += dDeltaAngle;
2242 2235
            if (AngleValue > 360) AngleValue -= 360;
......
2256 2249
                        Canvas.SetLeft(thumb, value.X);
2257 2250
                        Canvas.SetTop(thumb, value.Y);
2258 2251

  
2252
                        /*
2259 2253
                        if (item.DrawingData.GetType().Name == "ArrowTextControl" && thumb == item.ThumbList.Last())
2260 2254
                        {
2261 2255
                            Canvas.SetLeft(thumb, Canvas.GetLeft((item.DrawingData as ArrowTextControl).Base_TextBox));
......
2320 2314
                                //Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y);
2321 2315
                            }
2322 2316
                        }
2317
                        */
2323 2318
                    }
2324 2319

  
2325 2320
                    for (int i = 0; i < (item.DrawingData as IPath).PointSet.Count(); i++)
......
2327 2322
                        (item.DrawingData as IPath).PointSet[i] = MathSet.RotateAbout(CenterPoint, (item.DrawingData as IPath).PointSet[i], dDeltaAngle);
2328 2323
                    }
2329 2324
                }
2330
                #region 컨트롤 업데이트
2325
                #region 보더 업데이트
2331 2326
                foreach (var item in MemberSet)
2332 2327
                {
2333 2328
                    switch (item.Drawingtype)
2334 2329
                    {
2335 2330
                        case ControlType.TextControl:
2336 2331
                            ((TextControl)item.DrawingData).Angle = AngleValue;
2337
                            //trRotate.Angle = AngleValue;
2338 2332

  
2339 2333
                            RectangleGeometry Data = new RectangleGeometry
2340 2334
                            {
......
2491 2485
            BorderUpdate();
2492 2486
        }
2493 2487

  
2488
        /// <summary>
2489
        /// starting rotate
2490
        /// </summary>
2491
        /// <param name="sender"></param>
2492
        /// <param name="e"></param>
2494 2493
        private void rotate_DragStarted(object sender, DragStartedEventArgs e)
2495 2494
        {
2496
            //System.Windows.Forms.Cursor.Position = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X - 150, System.Windows.Forms.Cursor.Position.Y - 150);
2497 2495
            this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung
2498 2496
            rotateTop.Cursor = Cursors.SizeAll;
2499 2497

  
2500
            //CustomCursor.SetCursorTemplate(rotateTop, this.Resources["AnimatedCursor"] as DataTemplate);
2501
            //rotateTop.Cursor = Cursors.None;
2498
            /// get angle from text controls' angle if only text control exists - 2018.05.10 added by humkyung
2499
            if ((1 == MemberSet.Count) && (MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "TextControl")
2500
            {
2501
                this.AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle;
2502
            }
2503
            /// up to here
2502 2504

  
2503
            //if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().PointSet != null)
2504
            //{
2505
            //    return;
2506
            //}
2507 2505
            if (ViewerDataModel.Instance.UndoDataList == null)
2508 2506
            {
2509 2507
                return;

내보내기 Unified diff

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