Question
auto scale text box
Hi, i have this code for a subtitle text box size
var tex=thisComp.layer(index-1);
var w=tex.sourceRectAtTime(time-tex.inPoint,true).width;
s = 10;
if (marker.numKeys > 0){
m = marker.nearestKey(time);
t = m.time;
afterM= t+s*thisComp.frameDuration;
beforeM= t-s*thisComp.frameDuration;
aw = linear(w,0,1820,t,beforeM);
aw1 = linear(w,1820,0,t,afterM);
if (t<time){
ease(time,t,afterM,aw,w)
}else{
ease(time,t,beforeM,w,aw1)
}
}else{
w
}
I want the size of the box becomes the size of the next subtitle text smoothly, but in the above code, the size of the box becomes zero, and then it becomes the size of the text

how can i fix it?
