File tree Expand file tree Collapse file tree
WpfDesign.Designer/Project/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,8 +104,17 @@ protected virtual void drag_Started(DragListener drag)
104104 Line al = ExtendedItem . View as Line ;
105105 CurrentX2 = al . X2 ;
106106 CurrentY2 = al . Y2 ;
107- CurrentLeft = ( double ) al . GetValue ( Canvas . LeftProperty ) ;
108- CurrentTop = ( double ) al . GetValue ( Canvas . TopProperty ) ;
107+ CurrentLeft = al . Margin . Left ;
108+ CurrentTop = al . Margin . Top ;
109+ if ( ExtendedItem . Parent . View is Canvas )
110+ {
111+ var lp = ( double ) al . GetValue ( Canvas . LeftProperty ) ;
112+ if ( ! double . IsNaN ( lp ) )
113+ CurrentLeft += lp ;
114+ var tp = ( double ) al . GetValue ( Canvas . TopProperty ) ;
115+ if ( ! double . IsNaN ( tp ) )
116+ CurrentTop += tp ;
117+ }
109118
110119 var designPanel = ExtendedItem . Services . DesignPanel as DesignPanel ;
111120 zoom = designPanel . TryFindParent < ZoomControl > ( ) ;
You can’t perform that action at this time.
0 commit comments