Fixed an error that was showing up in new AE.

This commit is contained in:
2021-07-15 23:33:12 -07:00
parent 7604455e80
commit 2816bb00c1
+1 -1
View File
@@ -1 +1 @@
/* 0 center | 1 right | 2 left | 3 top | 4 bottom | 5 top right | 6 top left | 7 bottom right | 8 bottom left */function centerTextLayerAnchor( n ){ rect = thisLayer.sourceRectAtTime(); t = rect.top; h = rect.height x = rect.left + (rect.width/2); y = (t-( t-h)+(t*2))/2; switch (n){ rect = thisLayer.sourceRectAtTime(2); case 0 : offset = [0,0]; break; case 1 : offset = [ rect.width/2 , 0 , 0]; break; case 2 : offset = [ -rect.width/2 , 0 , 0]; break; case 3 : offset = [0 , -rect.height/2 , 0]; break; case 4 : offset = [0 , rect.height/2 , 0]; break; case 5 : offset = [ rect.width/2 , -rect.height/2 , 0]; break; case 6 : offset = [ -rect.width/2 , -rect.height/2 , 0]; break; case 7 : offset = [ rect.width/2 , rect.height/2 , 0]; break; case 8 : offset = [ -rect.width/2 , rect.height/2 , 0]; break; } newAnchor = [ x , y ] + offset; return newAnchor}centerTextLayerAnchor(0)
/* 0 center | 1 right | 2 left | 3 top | 4 bottom | 5 top right | 6 top left | 7 bottom right | 8 bottom left */function centerTextLayerAnchor( n ){ rect = thisLayer.sourceRectAtTime(); t = rect.top; h = rect.height x = rect.left + (rect.width/2); y = (t-( t-h)+(t*2))/2; rect = thisLayer.sourceRectAtTime(2); switch (n){ case 0 : offset = [0,0]; break; case 1 : offset = [ rect.width/2 , 0 , 0]; break; case 2 : offset = [ -rect.width/2 , 0 , 0]; break; case 3 : offset = [0 , -rect.height/2 , 0]; break; case 4 : offset = [0 , rect.height/2 , 0]; break; case 5 : offset = [ rect.width/2 , -rect.height/2 , 0]; break; case 6 : offset = [ -rect.width/2 , -rect.height/2 , 0]; break; case 7 : offset = [ rect.width/2 , rect.height/2 , 0]; break; case 8 : offset = [ -rect.width/2 , rect.height/2 , 0]; break; } newAnchor = [ x , y ] + offset; return newAnchor}centerTextLayerAnchor(0)