protected Rectangle applyClip ( Shape current , Rectangle newclip ) { if ( current == null ) return newclip ; else { if ( current instanceof Rectangle ) return ( ( Rectangle ) current ) . intersection ( newclip ) ; else return current . getBounds ( ) . intersection ( newclip ) ; } }
Computes a new clipping region from the current one and the eventual clipping box