Skip to content

Commit 2063a3b

Browse files
committed
Dynamic bbox fix
1 parent f5d4bce commit 2063a3b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dynamic_bbox.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ CompItem.prototype.dd_dynamicBbox_createBbox = function(_layer)
2626
var cbControlName = "ADBE Checkbox Control";
2727

2828
//expressions:
29-
var shapeSizeExpression = "textLayer = effect(\"target layer\")(\"Layer\");\nvar strokes = effect(\"accept strokes\")(\"Checkbox\");\nvar add = effect(\"add space\")(\"Slider\");\nbbox = textLayer.sourceRectAtTime(time,strokes);//bounding box вокруг текста\n[bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]+[add,add]//ширина bbox'а плюс немного отступа по краям";
30-
var textSizeExpression = "textLayer = effect(\"target layer\")(\"Layer\");\nvar add = effect(\"add space\")(\"Slider\");\nbbox = textLayer.sourceRectAtTime(time,false);//bounding box вокруг текста\n[bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]+[add,add]//ширина bbox'а плюс немного отступа по краям";
29+
var shapeSizeExpression = "textLayer = effect(\"Target Layer\")(\"Layer\");\nvar strokes = effect(\"Accept Strokes\")(\"Checkbox\");\nvar add = effect(\"Padding\")(\"Slider\");\nbbox = textLayer.sourceRectAtTime(time,strokes);//bounding box вокруг текста\n[bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]+[add,add]//ширина bbox'а плюс немного отступа по краям";
30+
var textSizeExpression = "textLayer = effect(\"Target Layer\")(\"Layer\");\nvar add = effect(\"Padding\")(\"Slider\");\nbbox = textLayer.sourceRectAtTime(time,false);//bounding box вокруг текста\n[bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]+[add,add]//ширина bbox'а плюс немного отступа по краям";
3131

32-
var shapePosExpression = "textLayer = effect(\"target layer\")(\"Layer\");\nvar strokes = effect(\"accept strokes\")(\"Checkbox\");\nbbox = textLayer.sourceRectAtTime(time,strokes);\ntextLayer.position-textLayer.anchorPoint+\n [bbox.left*textLayer.scale[0]/100,bbox.top*textLayer.scale[1]/100]+\n [bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]/2;";
33-
var textPosExpression = "textLayer = effect(\"target layer\")(\"Layer\");\nbbox = textLayer.sourceRectAtTime(time,false);\ntextLayer.position-textLayer.anchorPoint+\n [bbox.left*textLayer.scale[0]/100,bbox.top*textLayer.scale[1]/100]+\n [bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]/2;";
32+
var shapePosExpression = "textLayer = effect(\"Target Layer\")(\"Layer\");\nvar strokes = effect(\"Accept Strokes\")(\"Checkbox\");\nbbox = textLayer.sourceRectAtTime(time,strokes);\ntextLayer.position-textLayer.anchorPoint+\n [bbox.left*textLayer.scale[0]/100,bbox.top*textLayer.scale[1]/100]+\n [bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]/2;";
33+
var textPosExpression = "textLayer = effect(\"Target Layer\")(\"Layer\");\nbbox = textLayer.sourceRectAtTime(time,false);\ntextLayer.position-textLayer.anchorPoint+\n [bbox.left*textLayer.scale[0]/100,bbox.top*textLayer.scale[1]/100]+\n [bbox.width*textLayer.scale[0]/100,bbox.height*textLayer.scale[1]/100]/2;";
3434

3535
//creating shape layer
3636
var newShape = this.layers.addShape();

0 commit comments

Comments
 (0)