-
Position of a solid to middle of text
HI, I had a hard time titling this post.
I have a text layer in a precomp, ( justified to the left )and in the main composition I have a solid where the beginning of this solid ( the left side ), needs to be positioned in the middle of the text layer.
So if this text layer is 20 characters long, then the beginning of the solid will be at 10 characters,
and if the solid is 12 characters long, the solid would begin at 6 characters.I have the following expression that gets as close to possible to what I want, but I got there through trial and error. The math doesn’t make sense at all. I don’t see why I should divide by 1.7
If some one could suggest a fix and an explanation then that would be great.so in the position of the solid, my expression is;
gap = 10;
L = comp("text precomp").layer("text layer");
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width,0])[0];
[x/1.7+gap+width/2,value[1]]