-
Text box padding in only X value and not Y Question
Hi all, firstly you’ve helped me a lot on here in the past and thank you for that!
I have an expression that has been working well for automatically setting the size of a background box based on the text size for a MOGRT template.
The issue is that I need it to only set the X value or width of the box and not the Y value height.
Here is the expression at the moment:
title = thisComp.layer(“Text Line 2”).sourceRectAtTime();padding = effect(“Padding”)(“Slider”);[title.width + padding, title.height + padding];
This is linked to a slider that controls that padding.
The reason this is an issue is because the text is all caps and when you add a comma to the text the height of the background box increases and that needs to stay consistent as there are multiple lines of text below it in the layout.
I tried putting in a manual value for the Y height:
title = thisComp.layer(“Text Line 1”).sourceRectAtTime();padding = effect(“Padding”)(“Slider”);[title.width + padding, title.height + 26];
But it still increases the box height when you add a comma so I’m obviously doing something wrong.
I guess the solution is connecting only the X value to the padding slider but I’m unsure how to do this.
Any help gratefully received as always.
Thanks very much,
Merlintitle = thisComp.layer("Text Line 2").sourceRectAtTime();padding = effect("Padding")("Slider");[title.width + padding, title.height + padding];