private void checkForClipPath_OldStyle ( SvgElement obj , Box boundingBox ) { // Use the old/original method for clip paths // Locate the referenced object SvgObject ref = obj . document . resolveIRI ( state . style . clipPath ) ; if ( ref == null ) { error ( "ClipPath reference '%s' not found" , state . style . clipPath ) ; return ; } ClipPath clipPath = ( ClipPath ) ref ; // An empty clipping path will completely clip away the element (sect 14.3.5). if ( clipPath . children . isEmpty ( ) ) { canvas . clipRect ( 0 , 0 , 0 , 0 ) ; return ; } boolean userUnits = ( clipPath . clipPathUnitsAreUser == null || clipPath . clipPathUnitsAreUser ) ; if ( ( obj instanceof SVG . Group ) && ! userUnits ) { warn ( "<clipPath clipPathUnits=\"objectBoundingBox\"> is not supported when referenced from container elements (like %s)" , obj . getNodeName ( ) ) ; return ; } clipStatePush ( ) ; if ( ! userUnits ) { Matrix m = new Matrix ( ) ; m . preTranslate ( boundingBox . minX , boundingBox . minY ) ; m . preScale ( boundingBox . width , boundingBox . height ) ; canvas . concat ( m ) ; } if ( clipPath . transform != null ) { canvas . concat ( clipPath . transform ) ; } // "Properties inherit into the <clipPath> element from its ancestors; properties do not // inherit from the element referencing the <clipPath> element." (sect 14.3.5) state = findInheritFromAncestorState ( clipPath ) ; checkForClipPath ( clipPath ) ; Path combinedPath = new Path ( ) ; for ( SvgObject child : clipPath . children ) { addObjectToClip ( child , true , combinedPath , new Matrix ( ) ) ; } canvas . clipPath ( combinedPath ) ; clipStatePop ( ) ; }
Pre - KitKat . Kept for backwards compatibility .