From 8042c006b4810d4920b80c218b210949b685a9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lazar=20Ljubenovi=C4=87?= Date: Thu, 2 Jun 2022 17:15:20 +0200 Subject: [PATCH] Clarify that the object's mask must be in the subtree of its parent in the docs (#8378) --- packages/display/src/DisplayObject.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/display/src/DisplayObject.ts b/packages/display/src/DisplayObject.ts index 16cec45d84..37e723e741 100644 --- a/packages/display/src/DisplayObject.ts +++ b/packages/display/src/DisplayObject.ts @@ -936,7 +936,9 @@ export abstract class DisplayObject extends EventEmitter * Sets a mask for the displayObject. A mask is an object that limits the visibility of an * object to the shape of the mask applied to it. In PixiJS a regular mask must be a * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it - * utilities shape clipping. To remove a mask, set this property to `null`. + * utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent. + * Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong. + * To remove a mask, set this property to `null`. * * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. * @example