Skip to main content
Solved

In API response, render bound > bounding box but no difference is seen in Figma


In API response snippet to this Figma Design (https://www.figma.com/file/MruzGhJeyldwnG3HgxtUXk/SimpleTestFile?type=design&node-id=247%3A10&mode=design&t=L15KhW3qjdCHUB9L-1 ) below, the render bounds are larger than the bounding box but there is no visible indication of this in the Figma design editor. Why does the API give this response and what other situations is this behaviour seen?

1{
2 "id": "247:25",
3 "name": "White Towels",
4 "type": "TEXT",
5 "scrollBehavior": "SCROLLS",
6 "blendMode": "PASS_THROUGH",
7 "absoluteBoundingBox": {
8 "x": -378.0,
9 "y": -125.0,
10 "width": 367.0,
11 "height": 41.0
12 },
13 "absoluteRenderBounds": {
14 "x": -377.4531250,
15 "y": -119.0,
16 "width": 188.81250,
17 "height": 24.31250
18 },
19 "constraints": {
20 "vertical": "TOP",
21 "horizontal": "LEFT"
22 },
23 "fills": [
24 {
25 "blendMode": "NORMAL",
26 "type": "SOLID",
27 "color": {
28 "r": 1.0,
29 "g": 1.0,
30 "b": 1.0,
31 "a": 1.0
32 }
33 }
34 ],
35 "strokes": [],
36 "strokeWeight": 1.0,
37 "strokeAlign": "OUTSIDE",
38 "effects": [],
39 "characters": "White Towels",
40 "style": {
41 "fontFamily": "Roboto",
42 "fontPostScriptName": "RobotoRoman-Bold",
43 "fontWeight": 700,
44 "fontSize": 32.0,
45 "textAlignHorizontal": "LEFT",
46 "textAlignVertical": "TOP",
47 "letterSpacing": 0.0,
48 "lineHeightPx": 37.50,
49 "lineHeightPercent": 100.0,
50 "lineHeightUnit": "INTRINSIC_%"
51 },
52 "layoutVersion": 4,
53 "characterStyleOverrides": [],
54 "styleOverrideTable": {},
55 "lineTypes": [
56 "NONE"
57 ],
58 "lineIndentations": [
59 0
60 ]
61 }
62

Best answer by tank666

The render bounds are larger than the bounding box due to the “Drop shadow” effect applied to the frame.

View original
This topic has been closed for replies.

6 replies

tank666
  • 4873 replies
  • February 1, 2024

In fact, as you can see from the API response, the render bounds is smaller than the bounding box.

I also looked at your file, and I can say for sure that the render in the editor is completely consistent with the API response above. See screenshot:


Blue rectangle: bounding box.
Yellow rectangle: render bounds.


Sorry I just realised i included the wrong snippet, I am referring to the render bounds and bounding box for the frame

1 {
2 "id": "247:26",
3 "name": "row1_control",
4 "type": "FRAME",
5 "scrollBehavior": "SCROLLS",
6 "boundVariables": {
7 "fills": [
8 {
9 "type": "VARIABLE_ALIAS",
10 "id": "VariableID:cd8b39aca6f7b5dbc14f6f1424a78c9630d9918c/248:15"
11 }
12 ]
13 },
14 "blendMode": "PASS_THROUGH",
15 "children": [...]
16 "absoluteBoundingBox": {
17 "x": -386.0,
18 "y": -191.0,
19 "width": 753.0,
20 "height": 52.0
21 },
22 "absoluteRenderBounds": {
23 "x": -390.0,
24 "y": -193.0,
25 "width": 761.0,
26 "height": 60.0
27 },
28 "constraints": {
29 "vertical": "TOP",
30 "horizontal": "LEFT"
31 },
32 "layoutSizingHorizontal": "FIXED",
33 "layoutSizingVertical": "FIXED",
34 "clipsContent": true,
35 "background": [
36 {
37 "blendMode": "NORMAL",
38 "type": "SOLID",
39 "color": {
40 "r": 0.82745099067687988,
41 "g": 0.82745099067687988,
42 "b": 0.82745099067687988,
43 "a": 1.0
44 },
45 "boundVariables": {
46 "color": {
47 "type": "VARIABLE_ALIAS",
48 "id": "VariableID:cd8b39aca6f7b5dbc14f6f1424a78c9630d9918c/248:15"
49 }
50 }
51 }
52 ],
53 "fills": [
54 {
55 "blendMode": "NORMAL",
56 "type": "SOLID",
57 "color": {
58 "r": 0.82745099067687988,
59 "g": 0.82745099067687988,
60 "b": 0.82745099067687988,
61 "a": 1.0
62 },
63 "boundVariables": {
64 "color": {
65 "type": "VARIABLE_ALIAS",
66 "id": "VariableID:cd8b39aca6f7b5dbc14f6f1424a78c9630d9918c/248:15"
67 }
68 }
69 }
70 ],
71 "strokes": [],
72 "cornerRadius": 8.0,
73 "cornerSmoothing": 0.0,
74 "strokeWeight": 1.0,
75 "strokeAlign": "INSIDE",
76 "backgroundColor": {
77 "r": 0.82745099067687988,
78 "g": 0.82745099067687988,
79 "b": 0.82745099067687988,
80 "a": 1.0
81 },
82 "layoutMode": "HORIZONTAL",
83 "counterAxisSizingMode": "FIXED",
84 "itemSpacing": 10.0,
85 "primaryAxisSizingMode": "FIXED",
86 "counterAxisAlignItems": "CENTER",
87 "paddingLeft": 8.0,
88 "paddingRight": 8.0,
89 "paddingTop": 8.0,
90 "paddingBottom": 8.0,
91 "layoutWrap": "NO_WRAP",
92 "effects": [
93 {
94 "type": "DROP_SHADOW",
95 "visible": true,
96 "color": {
97 "r": 0.0,
98 "g": 0.0,
99 "b": 0.0,
100 "a": 0.250
101 },
102 "blendMode": "NORMAL",
103 "offset": {
104 "x": 0.0,
105 "y": 2.0
106 },
107 "radius": 4.0,
108 "showShadowBehindNode": false
109 }
110 ]
111 }
112


Point of correction: This is the part that has the render bound > bounding box. Here is the actual JSON response

1 {
2 "id": "247:26",
3 "name": "row1_control",
4 "type": "FRAME",
5 "scrollBehavior": "SCROLLS",
6 "boundVariables": {
7 "fills": [
8 {
9 "type": "VARIABLE_ALIAS",
10 "id": "VariableID:cd8b39aca6f7b5dbc14f6f1424a78c9630d9918c/248:15"
11 }
12 ]
13 },
14 "blendMode": "PASS_THROUGH",
15 "children": [...]
16 "absoluteBoundingBox": {
17 "x": -386.0,
18 "y": -191.0,
19 "width": 753.0,
20 "height": 52.0
21 },
22 "absoluteRenderBounds": {
23 "x": -390.0,
24 "y": -193.0,
25 "width": 761.0,
26 "height": 60.0
27 },
28 "constraints": {
29 "vertical": "TOP",
30 "horizontal": "LEFT"
31 },
32 "layoutSizingHorizontal": "FIXED",
33 "layoutSizingVertical": "FIXED",
34 "clipsContent": true,
35 "background": [
36 {
37 "blendMode": "NORMAL",
38 "type": "SOLID",
39 "color": {
40 "r": 0.82745099067687988,
41 "g": 0.82745099067687988,
42 "b": 0.82745099067687988,
43 "a": 1.0
44 },
45 "boundVariables": {
46 "color": {
47 "type": "VARIABLE_ALIAS",
48 "id": "VariableID:cd8b39aca6f7b5dbc14f6f1424a78c9630d9918c/248:15"
49 }
50 }
51 }
52 ],
53 "fills": [
54 {
55 "blendMode": "NORMAL",
56 "type": "SOLID",
57 "color": {
58 "r": 0.82745099067687988,
59 "g": 0.82745099067687988,
60 "b": 0.82745099067687988,
61 "a": 1.0
62 },
63 "boundVariables": {
64 "color": {
65 "type": "VARIABLE_ALIAS",
66 "id": "VariableID:cd8b39aca6f7b5dbc14f6f1424a78c9630d9918c/248:15"
67 }
68 }
69 }
70 ],
71 "strokes": [],
72 "cornerRadius": 8.0,
73 "cornerSmoothing": 0.0,
74 "strokeWeight": 1.0,
75 "strokeAlign": "INSIDE",
76 "backgroundColor": {
77 "r": 0.82745099067687988,
78 "g": 0.82745099067687988,
79 "b": 0.82745099067687988,
80 "a": 1.0
81 },
82 "layoutMode": "HORIZONTAL",
83 "counterAxisSizingMode": "FIXED",
84 "itemSpacing": 10.0,
85 "primaryAxisSizingMode": "FIXED",
86 "counterAxisAlignItems": "CENTER",
87 "paddingLeft": 8.0,
88 "paddingRight": 8.0,
89 "paddingTop": 8.0,
90 "paddingBottom": 8.0,
91 "layoutWrap": "NO_WRAP",
92 "effects": [
93 {
94 "type": "DROP_SHADOW",
95 "visible": true,
96 "color": {
97 "r": 0.0,
98 "g": 0.0,
99 "b": 0.0,
100 "a": 0.250
101 },
102 "blendMode": "NORMAL",
103 "offset": {
104 "x": 0.0,
105 "y": 2.0
106 },
107 "radius": 4.0,
108 "showShadowBehindNode": false
109 }
110 ]
111 }
112

tank666
  • 4873 replies
  • Answer
  • February 1, 2024

The render bounds are larger than the bounding box due to the “Drop shadow” effect applied to the frame.


That seems to be it. Thank you very much.
Do you know of other effects that do that do this? Also the effect doesn’t seem very visible, is that normal?


tank666
  • 4873 replies
  • February 1, 2024

The render bounds are affected by strokes, effects.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings