- int i_col = p_sys->i_selected % i_cols;
- int i_row = p_sys->i_selected / i_cols;
- int i_last_row = i_row + 1;
- i_row *= p_in->i_lines / i_rows;
- i_last_row *= p_in->i_lines / i_rows;
- memset( p_out->p_pixels + i_row * i_pitch + i_col * i_pitch / i_cols,
- 0xff, i_pitch / i_cols );
- for( ; i_row < i_last_row; i_row++ )
- {
- p_out->p_pixels[ i_row * i_pitch
- + i_col * i_pitch / i_cols ] = 0xff;
- p_out->p_pixels[ i_row * i_pitch
- + (i_col+1) * i_pitch / i_cols - 1 ] = 0xff;
+ /* Draw the borders of the selected slot */
+ if( i_plane == 0 && !p_sys->b_blackslot && p_sys->i_selected == i )
+ {
+ memset( p_out->p_pixels + i_row * p_out->i_pitch + i_col,
+ 0xff, i_piece_width );
+ for( int r = i_row; r < i_last_row; r++ )
+ {
+ p_out->p_pixels[r * p_out->i_pitch + i_col + 0 + 0 ] = 0xff;
+ p_out->p_pixels[r * p_out->i_pitch + i_col + i_piece_width - 1 ] = 0xff;
+ }
+ memset( p_out->p_pixels + (i_last_row - 1) * p_out->i_pitch + i_col,
+ 0xff, i_piece_width );
+ }