Code example for Region

Methods: containsopsetPath

0
					// http://stackoverflow.com/questions/2597590/how-can-i-tell-if-a-closed-path-contains-a-given-point 
					 
					RectF rectF = new RectF();
					mPathShape.computeBounds(rectF, true);
					 
					Region figRegion = new Region();
					figRegion.setPath(mPathShape, new Region((int)rectF.left, (int)rectF.top, (int)rectF.right, (int)rectF.bottom));
					 
					mPathClipRef.computeBounds(rectF, true);
					Region clipRegion = new Region();
					clipRegion.setPath(mPathClipRef, new Region((int)rectF.left, (int)rectF.top, (int)rectF.right, (int)rectF.bottom));
					 
					if(!clipRegion.isEmpty())
						figRegion.op(clipRegion, Region.Op.INTERSECT);
					 
					if(figRegion.contains((int)event.getX(), (int)event.getY())) {
						return performClickInsideFigure(); 
					} 
					//else 
					//	return false; 
				} 
Connect your IDE to all the code out there  Get Codota for Java