Copy link to clipboard
Copied
So I have this expression that's supposed to make my shape resize based on the text size. But for some reason, it doesn’t fully cover the text — it only covers part of it. I'm not very experienced with expressions, so I really can't figure out what's wrong. I put this expression in Rectangle Path - Size. Please help.
txt = thisComp.layer("Main Text");
x = txt.sourceRectAtTime(time, false);
txtlong = x.width;
sqwd = thisLayer.width;
t = time;
xPos = easeOut(t, inPoint, inPoint+0.5, 210, txtlong + 210);
[xPos, value[1]]
From your screen grab, it looks like you have the rectangle scaled to 70%.
Copy link to clipboard
Copied
Is your text scaled to more than 100%? If so, you'll need to adjust your txtlong value to account for that.
Copy link to clipboard
Copied
My text is 100% scaled, so i guess it's not it. I also tried to change font size of my text, but i didnt help either.
Copy link to clipboard
Copied
The expression is set up to start at a fixed width (210 px) and ease up to that size plus the width of the text. Are you saying that after the animation, the box is too small, or before the animation?
Copy link to clipboard
Copied
Yeah, that's the problem. The box is small after the animation.
it looks pretty simple to me, but for some reason it just doesn't work. I also have this expession for the position of the shape to have the same position as previous shape, but i dont think it has something to do with the problem.
Copy link to clipboard
Copied
From your screen grab, it looks like you have the rectangle scaled to 70%.
Copy link to clipboard
Copied
Yes! That was it. Thank you so much, idk why i didn't think about it.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now