expandBounds method

  1. @override
void expandBounds(
  1. GRect layerBounds,
  2. GRect outputBounds
)
override

(Internal usage) Expands the bounds of the filtered object to include the outline.

This method overrides the default implementation of expandBounds in the GComposerFilter class. It expands the bounds of the filtered object by creating a new GRect that is the same size as the layer bounds, and then inflating it by 2 logical pixels in all directions. The resulting GRect is then added to the output bounds.

The layerBounds parameter is the original bounds of the filtered object.

The outputBounds parameter is the bounds that the filtered object will be rendered to.

Implementation

@override
void expandBounds(GRect layerBounds, GRect outputBounds) {
  super.expandBounds(layerBounds, outputBounds);
  _rect.copyFrom(layerBounds).inflate(2, 2);
  outputBounds.expandToInclude(_rect);
}