Skip to content

Conversation

@brycethomas
Copy link
Contributor

The plane width/height was being calculated when the text value was first set, but would not update when the text changed.

Documentation has also been updated to advise using 0 rather than auto for autoscaling behavior. This is based on the the comment here suggesting that auto is not a valid value for geometry (NaN is falsy, so it happened to still work).

The plane width/height was being calculated when the text value was first set,
but would not update when the text changed.

Documentation has also been updated to advise using `0` rather than `auto`
for autoscaling behavior.  This is based on the the comment
[here](aframevr#2837 (comment))
suggesting that `auto` is not a valid value for geometry (NaN is falsy, so it
happened to still work).
@dmarcos
Copy link
Member

dmarcos commented Oct 10, 2023

Thanks for taking the time. Have been a while I touched this code. Your knowledge is more fresh. At first look I would expect the update method to be called when updating the text and this logic to change the plane size to execute:

https://github.com/aframevr/aframe/pull/5357/files#diff-59e71534a2828d71b6a8c63a750a375c722e58636a0717b4afef195333e773d3L305

Why is not working as expected?

@brycethomas
Copy link
Contributor Author

The old code checks whether the geometry width/height is falsy, and if so, sets the geometry width/height. On the next run through update the width/height will no longer be falsy (it was set on the prior update), and so the width/height doesn't get adjusted when the text changes.

@dmarcos
Copy link
Member

dmarcos commented Oct 19, 2023

Thanks for the tests!

@dmarcos dmarcos merged commit d8ade4f into aframevr:master Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants