@@ -61,18 +61,13 @@ private void MainForm_Paint(object sender, PaintEventArgs e)
6161 // Reordering
6262 if ( VisionBoard . Current . Reordering )
6363 {
64- VisionBoard . Current . OrderIndex = 0 ;
64+ VisionBoard . Current . OrderIndex = VisionBoard . Current . Items . Count ;
6565 VisionBoard . Current . Draw ( bitmapG ) ;
6666 }
6767 else
6868 {
6969 // Draw Non-Selected to Bitmap
70- for ( int i = VisionBoard . Current . Items . Count - 1 ; i >= 0 ; i -- )
71- {
72- ImageItem item = ( ImageItem ) VisionBoard . Current . Items [ i ] ;
73- if ( item != selectedItem )
74- item . Draw ( bitmapG ) ;
75- }
70+ VisionBoard . Current . Draw ( bitmapG , selectedItem ) ;
7671
7772 // Draw Selected to Bitmap
7873 if ( selectedItem != null )
@@ -171,7 +166,7 @@ private void MainForm_MouseDown(object sender, MouseEventArgs e)
171166 {
172167 ImageItem item = ( ImageItem ) VisionBoard . Current . Items [ i ] ;
173168
174- if ( VisionBoard . Current . Reordering && VisionBoard . Current . ReorderCurrentIndex > i )
169+ if ( VisionBoard . Current . Reordering && VisionBoard . Current . ReorderCurrentIndex - 1 > i )
175170 continue ;
176171
177172 if ( item . HitTest ( clickedPoint . X , clickedPoint . Y ) )
@@ -188,16 +183,16 @@ private void MainForm_MouseDown(object sender, MouseEventArgs e)
188183 if ( VisionBoard . Current . Reordering && selectedIndex >= 0 )
189184 {
190185 // change order
191- if ( selectedIndex != VisionBoard . Current . ReorderCurrentIndex )
186+ if ( selectedIndex != VisionBoard . Current . ReorderCurrentIndex - 1 )
192187 {
193188 VisionBoard . Current . Items . RemoveAt ( selectedIndex ) ;
194- VisionBoard . Current . Items . Insert ( VisionBoard . Current . ReorderCurrentIndex , selectedItem ) ;
189+ VisionBoard . Current . Items . Insert ( VisionBoard . Current . ReorderCurrentIndex - 1 , selectedItem ) ;
195190 VisionBoard . Current . IsDirty = true ;
196191 }
197192
198193 // increment ReorderCurrentIndex
199194 VisionBoard . Current . ReorderCurrentIndex ++ ;
200- if ( VisionBoard . Current . ReorderCurrentIndex >= VisionBoard . Current . Items . Count )
195+ if ( VisionBoard . Current . ReorderCurrentIndex > VisionBoard . Current . Items . Count )
201196 VisionBoard . Current . Reordering = false ;
202197
203198 selectedItem = null ;
@@ -346,7 +341,7 @@ private void miReorder_Click(object sender, EventArgs e)
346341 {
347342 selectedItem = null ;
348343 VisionBoard . Current . Reordering = ! VisionBoard . Current . Reordering ;
349- VisionBoard . Current . ReorderCurrentIndex = 0 ;
344+ VisionBoard . Current . ReorderCurrentIndex = 1 ;
350345 Invalidate ( ) ;
351346 }
352347
0 commit comments