playcanvas / playcanvas/engine
Text Element AABB is not calculated when disabled
@jpauloruschel is already working on this.
Since Jan 4, 2022.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Text Element, if initially disabled, does not calculates AABB. Only calculates on first enable.
Although for Model component, mesh instances AABBs are calculated, and updated, regardless of enable state of mesh instance, model component or entity.
This leads to couple of issues, when AABBs are desired by developer before enabling an entity.
Also in Editor, AABBs will be wrong due to that.
Here is a project with issue replication: https://playcanvas.com/project/692477/overview/disabled-text-element-aabb-issue
- Select "2D Screen"
- Note AABBs gizmo is including Origin (that is where "Text" element AABB is as default, not calculated, because it is disabled).
- Hit "F" to Focus
- Note focusing is wrong also.
When enabling "Text" entity, issue goes away, but then disabling again and moving, leads to issue of wrong AABB again:
- Select "Text" entity
- Enable it
- Disable it
- Move 2D Screen
- Note how AABB again is wrong, especially, due to not updated "Text" element AABB.
Solution: calculate AABB for Text Element, same way as it is calculated for Image Element and for other components with AABBs, regardless of being enabled.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.