INNER CODE UNIT · Java
calculateLayout
florent37/ShapeOfView · shapeofview/src/main/java/io/github/florent37/shapeofview/ShapeOfView.java:162
private void calculateLayout(int width, int height) {
rectView.reset();
rectView.addRect(0f, 0f, 1f * getWidth(), 1f * getHeight(), Path.Direction.CW);
if (clipManager != null) {
if (width > 0 && height > 0) {
clipManager.setupClipLayout(width, height);
clipPath.reset();
clipPath.set(clipManager.createMask(width, height));
if (requiresBitmap()) {
if (clipBitmap != null) {
clipBitmap.recycle();
}
clipBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(clipBitmap);
if (drawable != null) {