@@ -2764,6 +2764,7 @@ ArrangePanel.prototype.addEdgeGeometryHandler = function(input, fn)
2764
2764
*/
2765
2765
ArrangePanel . prototype . addEdgeGeometry = function ( container )
2766
2766
{
2767
+ var panel = this ;
2767
2768
var ui = this . editorUi ;
2768
2769
var graph = ui . editor . graph ;
2769
2770
var rect = ui . getSelectionState ( ) ;
@@ -2819,14 +2820,14 @@ ArrangePanel.prototype.addEdgeGeometry = function(container)
2819
2820
mxUtils . write ( span , mxResources . get ( 'linestart' ) ) ;
2820
2821
divs . appendChild ( span ) ;
2821
2822
2822
- var xs = this . addUnitInput ( divs , 'pt' , 87 , 52 , function ( )
2823
+ var xs = this . addUnitInput ( divs , this . getUnit ( ) , 87 , 52 , function ( )
2823
2824
{
2824
2825
xsUpdate . apply ( this , arguments ) ;
2825
- } ) ;
2826
- var ys = this . addUnitInput ( divs , 'pt' , 16 , 52 , function ( )
2826
+ } , this . getUnitStep ( ) , null , null , this . isFloatUnit ( ) ) ;
2827
+ var ys = this . addUnitInput ( divs , this . getUnit ( ) , 16 , 52 , function ( )
2827
2828
{
2828
2829
ysUpdate . apply ( this , arguments ) ;
2829
- } ) ;
2830
+ } , this . getUnitStep ( ) , null , null , this . isFloatUnit ( ) ) ;
2830
2831
2831
2832
mxUtils . br ( divs ) ;
2832
2833
this . addLabel ( divs , mxResources . get ( 'left' ) , 87 , 64 ) ;
@@ -2845,14 +2846,14 @@ ArrangePanel.prototype.addEdgeGeometry = function(container)
2845
2846
mxUtils . write ( span , mxResources . get ( 'lineend' ) ) ;
2846
2847
divt . appendChild ( span ) ;
2847
2848
2848
- var xt = this . addUnitInput ( divt , 'pt' , 87 , 52 , function ( )
2849
+ var xt = this . addUnitInput ( divt , this . getUnit ( ) , 87 , 52 , function ( )
2849
2850
{
2850
2851
xtUpdate . apply ( this , arguments ) ;
2851
- } ) ;
2852
- var yt = this . addUnitInput ( divt , 'pt' , 16 , 52 , function ( )
2852
+ } , this . getUnitStep ( ) , null , null , this . isFloatUnit ( ) ) ;
2853
+ var yt = this . addUnitInput ( divt , this . getUnit ( ) , 16 , 52 , function ( )
2853
2854
{
2854
2855
ytUpdate . apply ( this , arguments ) ;
2855
- } ) ;
2856
+ } , this . getUnitStep ( ) , null , null , this . isFloatUnit ( ) ) ;
2856
2857
2857
2858
mxUtils . br ( divt ) ;
2858
2859
this . addLabel ( divt , mxResources . get ( 'left' ) , 87 , 64 ) ;
@@ -2889,8 +2890,8 @@ ArrangePanel.prototype.addEdgeGeometry = function(container)
2889
2890
if ( geo != null && geo . sourcePoint != null &&
2890
2891
graph . model . getTerminal ( cell , true ) == null )
2891
2892
{
2892
- xs . value = geo . sourcePoint . x ;
2893
- ys . value = geo . sourcePoint . y ;
2893
+ xs . value = this . inUnit ( geo . sourcePoint . x ) + ' ' + this . getUnit ( ) ;
2894
+ ys . value = this . inUnit ( geo . sourcePoint . y ) + ' ' + this . getUnit ( ) ;
2894
2895
}
2895
2896
else
2896
2897
{
@@ -2900,8 +2901,8 @@ ArrangePanel.prototype.addEdgeGeometry = function(container)
2900
2901
if ( geo != null && geo . targetPoint != null &&
2901
2902
graph . model . getTerminal ( cell , false ) == null )
2902
2903
{
2903
- xt . value = geo . targetPoint . x ;
2904
- yt . value = geo . targetPoint . y ;
2904
+ xt . value = this . inUnit ( geo . targetPoint . x ) + ' ' + this . getUnit ( ) ;
2905
+ yt . value = this . inUnit ( geo . targetPoint . y ) + ' ' + this . getUnit ( ) ;
2905
2906
}
2906
2907
else
2907
2908
{
@@ -2917,22 +2918,22 @@ ArrangePanel.prototype.addEdgeGeometry = function(container)
2917
2918
2918
2919
xsUpdate = this . addEdgeGeometryHandler ( xs , function ( geo , value )
2919
2920
{
2920
- geo . sourcePoint . x = value ;
2921
+ geo . sourcePoint . x = panel . fromUnit ( value ) ;
2921
2922
} ) ;
2922
2923
2923
2924
ysUpdate = this . addEdgeGeometryHandler ( ys , function ( geo , value )
2924
2925
{
2925
- geo . sourcePoint . y = value ;
2926
+ geo . sourcePoint . y = panel . fromUnit ( value ) ;
2926
2927
} ) ;
2927
2928
2928
2929
xtUpdate = this . addEdgeGeometryHandler ( xt , function ( geo , value )
2929
2930
{
2930
- geo . targetPoint . x = value ;
2931
+ geo . targetPoint . x = panel . fromUnit ( value ) ;
2931
2932
} ) ;
2932
2933
2933
2934
ytUpdate = this . addEdgeGeometryHandler ( yt , function ( geo , value )
2934
2935
{
2935
- geo . targetPoint . y = value ;
2936
+ geo . targetPoint . y = panel . fromUnit ( value ) ;
2936
2937
} ) ;
2937
2938
2938
2939
graph . getModel ( ) . addListener ( mxEvent . CHANGE , listener ) ;
0 commit comments