code: @Override
      public void clipView(@Nullable RectF rect, float rotation) {
          if (rect == null) {
              if (isClipping) {
                  isClipping = false;
                  view.invalidate();
              }
          } else {
              // Setting previous clip rect
              if (isClipping) {
                  clipBoundsOld.set(clipBounds);
              } else {
                  clipBoundsOld.set(0f, 0f, view.getWidth(), view.getHeight());
              }
  
              isClipping = true;
  
              clipRect.set(rect);
              clipRotation = rotation;
  
              // Computing upper bounds of clipping rect after rotation (if any)
              clipBounds.set(clipRect);
              if (!State.equals(rotation, 0f)) {
                  tmpMatrix.setRotate(rotation, clipRect.centerX(), clipRect.centerY());
                  tmpMatrix.mapRect(clipBounds);
              }
  
              // Invalidating only updated part (min area holding both new and old clip bounds)
              int left = (int) Math.min(clipBounds.left, clipBoundsOld.left);
              int top = (int) Math.min(clipBounds.top, clipBoundsOld.top);
              int right = (int) Math.max(clipBounds.right, clipBoundsOld.right) + 1;
              int bottom = (int) Math.max(clipBounds.bottom, clipBoundsOld.bottom) + 1;
              view.invalidate(left, top, right, bottom);
          }
      }
docs: {@inheritDoc}