Could be better if the second expression, instead of changing the shape’s scale, controlled the rectangle path size, that way any round corners wouldn’t be distorted. I’ll try and figure it out myself but the last line of that expression is a bit much for me this morning 😀
This is not a solution but a workaround. What I did was to simply mask the shape layer to get cropped on the left side (or whichever side you wish). I also repositioned the shape so its center was on top of the beginning of the editable text.
I changed the code a bit as well to match my design:
I’m trying to use this code for a text layer for subtitles, so as the voiceover changes, I have another text keyframe and I’d like the box to adjust as the text changes in width. Seems like the code only is seeing the last keyframe text width size. I’m assuming this is because the code doesn’t execute every time there is a new keyframe…is there a way to do this?