Make 'crop' command crop to rectangle too.
This commit is contained in:
parent
d8fe1ad003
commit
db1b2f63e7
5
canvas.C
5
canvas.C
|
@ -798,7 +798,10 @@ Canvas::invert_selection ( void )
|
|||
void
|
||||
Canvas::crop ( void )
|
||||
{
|
||||
m.grid->crop( m.p1, m.p2 );
|
||||
if ( m.p3 == m.p4 )
|
||||
m.grid->crop( m.p1, m.p2 );
|
||||
else
|
||||
m.grid->crop( m.p1, m.p2, rtn( m.p3 ), rtn( m.p4 ) );
|
||||
|
||||
m.vp->x = 0;
|
||||
|
||||
|
|
19
grid.C
19
grid.C
|
@ -594,6 +594,25 @@ Grid::crop ( int l, int r )
|
|||
unlock();
|
||||
}
|
||||
|
||||
void
|
||||
Grid::crop ( int l, int r, int t, int b )
|
||||
{
|
||||
lock();
|
||||
|
||||
_rw->events.push_selection();
|
||||
|
||||
select( l, r, t, b );
|
||||
|
||||
_rw->events.invert_selection();
|
||||
_rw->events.remove_selected();
|
||||
|
||||
_rw->events.pop_selection();
|
||||
|
||||
crop( l, r );
|
||||
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Grid::_relink ( void )
|
||||
|
|
Loading…
Reference in New Issue