프로젝트

일반

사용자정보

개정판 a1716fa5

IDa1716fa5f077a3ac6f92ed06abbb46a3c571820a
상위 9cd2865b
하위 8e2743a3

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

Compare시 우측 화면 Zoom & Move 이벤트 추가

차이점 보기:

KCOM/Views/MainMenu.xaml
236 236
                        </telerik:RadDocumentPane>
237 237
                    </telerik:RadPaneGroup>
238 238
                    <telerik:RadPaneGroup Style="{DynamicResource Style_RadPanelGroup}" >
239
                        <telerik:RadPane CanFloat="False" CanUserClose="False" Title="Document 1" PaneHeaderVisibility="Collapsed" x:Name="testPanel2" IsHidden="True" Margin="0,-20,0,0">
239
                        <telerik:RadPane CanFloat="False" CanUserClose="False" Title="Document 1" PaneHeaderVisibility="Collapsed" x:Name="testPanel2" IsHidden="True" Margin="0,-20,0,0" >
240 240
                            <Grid Background="{DynamicResource KCOMColor_DocumnetBackgroundBrush}">
241 241
                                <ZoomAndPan:ZoomAndPanControl x:Name="zoomAndPanControl2" 
242
                                                              MouseWheel="zoomAndPanControl2_MouseWheel"
243
                                                              MouseMove="zoomAndPanControl2_MouseMove"
244
                                                              MouseDown="zoomAndPanControl2_MouseDown"
245
                                                              MouseUp="zoomAndPanControl2_MouseUp"
246
                                                              MouseLeave="zoomAndPanControl_MouseLeave"
242 247
                                                              ContentScale="{Binding Sync_ContentScale, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
243 248
                                                              ContentOffsetX="{Binding Sync_ContentOffsetX, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
244 249
                                                              ContentOffsetY="{Binding Sync_ContentOffsetY, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
245 250
                                                              ConstrainedContentViewportWidth="{Binding ContentViewportWidth, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
246 251
                                                              ConstrainedContentViewportHeight="{Binding ContentViewportHeight, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
247 252
                                                              Background="LightGray">
248
                                    <Canvas x:Name="zoomAndPanCanvas2" Opacity="1" Background="White" >
253
                                    <Canvas x:Name="zoomAndPanCanvas2" Opacity="1" Background="White">
249 254
                                        <Canvas x:Name="drawingRotateCanvas2"
250 255
                                                        Panel.ZIndex="1"
251 256
                                                        Background="{Binding BackgroundImage, Mode=OneWay, Source={x:Static common:ViewerDataModel.Instance}}">
......
282 287
                                        </Canvas>
283 288
                                    </Canvas>
284 289
                                </ZoomAndPan:ZoomAndPanControl>
285
                                <Grid Background="#FF353535" Opacity="0.5"/>
290
                                <Grid Background="#FF353535" Opacity="0.5" IsHitTestVisible="False"/>
286 291

  
287
                                <Viewbox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" StretchDirection="DownOnly" Stretch="Uniform">
292
                                <Viewbox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" StretchDirection="DownOnly" Stretch="Uniform" IsHitTestVisible="False">
288 293
                                    <TextBlock Text="Previous Document" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5, 0.5" FontSize="50"
289 294
                                           Foreground="White" Opacity="0.5" FontWeight="Bold">
290 295
                                        <TextBlock.RenderTransform>
KCOM/Views/MainMenu.xaml.cs
489 489
            ViewerDataModel.Instance.PageNumber = BalancePoint;
490 490

  
491 491
            string uri = "";
492
            if (userData.COMPANY !="EXT")
492
            if (userData.COMPANY != "EXT")
493 493
            {
494 494
                uri = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, e.PageNumber);
495 495
            }
......
556 556
                else
557 557
                {
558 558
                    string uri2 = "";
559
                    if (userData.COMPANY !="EXT")
559
                    if (userData.COMPANY != "EXT")
560 560
                    {
561 561
                        uri2 = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, BalancePoint);
562 562
                    }
......
564 564
                    {
565 565
                        uri2 = String.Format(Properties.Settings.Default.subServerImageWebPath, _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, BalancePoint);
566 566
                    }
567
                    
567

  
568 568

  
569 569
                    var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri2));
570 570

  
......
713 713
            }
714 714
        }
715 715

  
716
        private void zoomAndPanControl2_MouseWheel(object sender, MouseWheelEventArgs e)
717
        {
718
            e.Handled = true;
719
            if (e.Delta > 0)
720
            {
721
                Point currentContentMousePoint = e.GetPosition(zoomAndPanCanvas2);
722
                ZoomIn_Sync(currentContentMousePoint);
723
            }
724
            else
725
            {
726
                Point currentContentMousePoint = e.GetPosition(zoomAndPanCanvas2);
727
                ZoomOut_Sync(currentContentMousePoint);
728
            }
729
        }
730

  
716 731
        #region ZoomIn & ZoomOut
717 732

  
718 733
        private void ZoomOut_Executed(object sender, ExecutedRoutedEventArgs e)
......
762 777
            {
763 778
                zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl.ContentScale, contentZoomCenter);
764 779
            }
780

  
781
        }
782

  
783
        private void ZoomOut_Sync(Point contentZoomCenter)
784
        {
785
            if (zoomAndPanControl2.ContentScale > 0.39)
786
            {
787
                zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale - 0.2, contentZoomCenter);
788
            }
789
            else
790
            {
791
                zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale / 2, contentZoomCenter);
792
            }
793

  
794
            if (Sync.IsChecked)
795
            {
796
                zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl2.ContentScale, contentZoomCenter);
797
            }
798
        }
799

  
800
        private void ZoomIn_Sync(Point contentZoomCenter)
801
        {
802
            if (zoomAndPanControl2.ContentScale > 0.19)
803
            {
804
                zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale + 0.2, contentZoomCenter);
805
            }
806
            else
807
            {
808
                zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale * 2, contentZoomCenter);
809
            }
810

  
811
            if (Sync.IsChecked)
812
            {
813
                zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl2.ContentScale, contentZoomCenter);
814
            }
765 815
        }
766 816

  
767 817
        private void ZoomOut()
......
1069 1119
                zoomAndPanControl.ContentOffsetX -= dragOffset.X;
1070 1120
                zoomAndPanControl.ContentOffsetY -= dragOffset.Y;
1071 1121

  
1072
                if(Sync.IsChecked)
1122
                if (Sync.IsChecked)
1073 1123
                {
1074 1124
                    ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX;
1075 1125
                    ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY;
......
2257 2307
            }
2258 2308
        }
2259 2309

  
2310
        private void zoomAndPanControl2_MouseMove(object sender, MouseEventArgs e)
2311
        {
2312
            if ((mouseButtonDown == MouseButton.Middle) || (mouseButtonDown == MouseButton.Right))
2313
            {
2314
                SetCursor();
2315
                Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas2);
2316
                Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas2);
2317

  
2318
                Vector dragOffset = currentCanvasZoomPanningMouseMovePoint - canvasZoommovingMouseDownPoint;
2319

  
2320
                ViewerDataModel.Instance.Sync_ContentOffsetX -= dragOffset.X;
2321
                ViewerDataModel.Instance.Sync_ContentOffsetY -= dragOffset.Y;
2322

  
2323
                if (Sync.IsChecked)
2324
                {
2325
                    zoomAndPanControl.ContentOffsetX = ViewerDataModel.Instance.Sync_ContentOffsetX;
2326
                    zoomAndPanControl.ContentOffsetY = ViewerDataModel.Instance.Sync_ContentOffsetY;
2327
                }
2328
            }
2329
        }
2330

  
2260 2331
        private List<CommentUserInfo> hitList = new List<CommentUserInfo>();
2261 2332

  
2262 2333
        private EllipseGeometry hitArea = new EllipseGeometry();
......
2365 2436
            //controlType = ControlType.SingleLine;
2366 2437
        }
2367 2438

  
2439
        private void zoomAndPanControl2_MouseUp(object sender, MouseButtonEventArgs e)
2440
        {
2441
            mouseButtonDown = MouseButton.Left;
2442
        }
2443

  
2368 2444
        private void zoomAndPanControl_MouseLeave(object sender, MouseEventArgs e)
2369 2445
        {
2370 2446
            mouseButtonDown = MouseButton.Left;
......
2495 2571
                dragCaptureBorder.Height = height;
2496 2572
            }
2497 2573
            //선택 중
2498
            else if(mouseHandlingMode == MouseHandlingMode.Selecting)
2574
            else if (mouseHandlingMode == MouseHandlingMode.Selecting)
2499 2575
            {
2500 2576
                Canvas.SetLeft(dragSelectionBorder, x);
2501 2577
                Canvas.SetTop(dragSelectionBorder, y);
......
2598 2674
            var text_item = ViewerDataModel.Instance.MarkupControls_USER.Where(data =>
2599 2675
            (data as TextControl) != null && (data as TextControl).Text == "" || (data as ArrowTextControl) != null && (data as ArrowTextControl).ArrowText == "").FirstOrDefault();
2600 2676

  
2601
            if(text_item != null && (currentControl as ArrowTextControl) == null)
2677
            if (text_item != null && (currentControl as ArrowTextControl) == null)
2602 2678
            {
2603 2679
                ViewerDataModel.Instance.MarkupControls_USER.Remove(text_item);
2604 2680
            }
......
4190 4266
            }
4191 4267
        }
4192 4268

  
4269
        private void zoomAndPanControl2_MouseDown(object sender, MouseButtonEventArgs e)
4270
        {
4271
            mouseButtonDown = e.ChangedButton;
4272
            canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas2);
4273
        }
4274

  
4193 4275
        private void RemoveLineStroke(Point P)
4194 4276
        {
4195 4277
            var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault();
......
4414 4496
                    ViewerDataModel.Instance.PageNumber = 1;
4415 4497
                }
4416 4498

  
4417
                BaseClient.GetCompareRectAsync(_ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber.ToString(), ViewerDataModel.Instance.PageNumber.ToString(), userData.COMPANY !="EXT" ? true :false);
4499
                BaseClient.GetCompareRectAsync(_ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber.ToString(), ViewerDataModel.Instance.PageNumber.ToString(), userData.COMPANY != "EXT" ? true : false);
4418 4500
            }
4419 4501
            else
4420 4502
            {
......
4429 4511

  
4430 4512
        private void Sync_Click(object sender, RoutedEventArgs e)
4431 4513
        {
4432
            if(Sync.IsChecked)
4514
            if (Sync.IsChecked)
4433 4515
            {
4434 4516
                ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX;
4435 4517
                ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY;
......
4755 4837
                    gridViewRevMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoRevList;
4756 4838

  
4757 4839
                    string uri = "";
4758
                    if (userData.COMPANY !="EXT")
4840
                    if (userData.COMPANY != "EXT")
4759 4841
                    {
4760 4842
                        uri = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber);
4761 4843
                    }
......
5363 5445
                            {
5364 5446
                                (item.Markup as IDashControl).DashSize = redo.DashSize;
5365 5447
                            }
5366
                            else if(redo.Interval != 0 && item.Markup as LineControl != null)
5448
                            else if (redo.Interval != 0 && item.Markup as LineControl != null)
5367 5449
                            {
5368 5450
                                (item.Markup as LineControl).Interval = redo.Interval;
5369 5451
                            }
......
5522 5604

  
5523 5605
            return res;
5524 5606
        }
5607

  
5608
       
5525 5609
    }
5526 5610
}

내보내기 Unified diff

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