@@ -10,26 +10,26 @@ partial class EditSelForm : QlibFixedForm
1010 public EditSelForm ( Rectangle r )
1111 {
1212 InitializeComponent ( ) ;
13- SetSelection ( r . X , r . Y , r . Width , r . Height ) ;
13+ SetSelection ( r ) ;
1414 }
1515
16- public void SetSelection ( int x , int y , int w , int h )
16+ public void SetSelection ( Rectangle r )
1717 {
18- if ( x < xNumeric . Minimum ) x = ( int ) xNumeric . Minimum ;
19- if ( x > xNumeric . Maximum ) x = ( int ) xNumeric . Maximum ;
20- xNumeric . Value = x ;
18+ if ( r . X < xNumeric . Minimum ) r . X = ( int ) xNumeric . Minimum ;
19+ if ( r . X > xNumeric . Maximum ) r . X = ( int ) xNumeric . Maximum ;
20+ xNumeric . Value = r . X ;
2121
22- if ( y < yNumeric . Minimum ) y = ( int ) yNumeric . Minimum ;
23- if ( y > yNumeric . Maximum ) y = ( int ) yNumeric . Maximum ;
24- yNumeric . Value = y ;
22+ if ( r . Y < yNumeric . Minimum ) r . Y = ( int ) yNumeric . Minimum ;
23+ if ( r . Y > yNumeric . Maximum ) r . Y = ( int ) yNumeric . Maximum ;
24+ yNumeric . Value = r . Y ;
2525
26- if ( w < widthNumeric . Minimum ) w = ( int ) widthNumeric . Minimum ;
27- if ( w > widthNumeric . Maximum ) w = ( int ) widthNumeric . Maximum ;
28- widthNumeric . Value = w ;
26+ if ( r . Width < widthNumeric . Minimum ) r . Width = ( int ) widthNumeric . Minimum ;
27+ if ( r . Width > widthNumeric . Maximum ) r . Width = ( int ) widthNumeric . Maximum ;
28+ widthNumeric . Value = r . Width ;
2929
30- if ( h < heightNumeric . Minimum ) h = ( int ) heightNumeric . Minimum ;
31- if ( h > heightNumeric . Maximum ) h = ( int ) heightNumeric . Maximum ;
32- heightNumeric . Value = h ;
30+ if ( r . Height < heightNumeric . Minimum ) r . Height = ( int ) heightNumeric . Minimum ;
31+ if ( r . Height > heightNumeric . Maximum ) r . Height = ( int ) heightNumeric . Maximum ;
32+ heightNumeric . Value = r . Height ;
3333 }
3434
3535 private void SetDarkMode ( bool dark )
@@ -73,20 +73,12 @@ private void InitLanguage()
7373
7474 private void xNumeric_ValueChanged ( object sender , EventArgs e )
7575 {
76- if ( Owner != null )
77- {
78- Rectangle r = ( Owner as MainForm ) . SelectSelection (
79- ( int ) xNumeric . Value ,
80- ( int ) yNumeric . Value ,
81- ( int ) widthNumeric . Value ,
82- ( int ) heightNumeric . Value
83- ) ;
84-
85- if ( xNumeric . Value != r . X ) xNumeric . Value = r . X ;
86- if ( yNumeric . Value != r . Y ) yNumeric . Value = r . Y ;
87- if ( widthNumeric . Value != r . Width ) widthNumeric . Value = r . Width ;
88- if ( heightNumeric . Value != r . Height ) heightNumeric . Value = r . Height ;
89- }
76+ if ( Owner != null ) ( Owner as MainForm ) . SelectSelection (
77+ ( int ) xNumeric . Value ,
78+ ( int ) yNumeric . Value ,
79+ ( int ) widthNumeric . Value ,
80+ ( int ) heightNumeric . Value
81+ ) ;
9082 }
9183 }
9284}
0 commit comments