Tried to find my answers in the doucumentation for text widgets, but without much success. This is what I’m looking at:
I can’t figure out which width attribute corresponds to what exactly since they are both different in value. And if both of these width attributes impact something different, or if they both just determine the actual width of the text widget, where one of the attributes has priority over the other.
Also the reason why I would even want to set width manually, is that when creating a text widget with a API call and simply giving it some text, it doesn’t determine the expected width well enough, for the text to fit in a single line.
The call beneath will give me this result ^
await miro.board.widgets.create({
"capabilities" : {
"editable" : true
},
"scale" : textSize,
"rotation" : 270,
"style" : {
"backgroundColor" : "transparent",
"backgroundOpacity" : 1,
"bold" : 0,
"borderColor" : "transparent",
"borderOpacity" : 1,
"borderStyle" : 2,
"borderWidth" : 2,
"fontFamily" : 10,
"highlighting" : 0,
"italic" : 0,
"padding" : undefined,
"strike" : 0,
"textAlign" : "l",
"textColor" : "#1a1a1a",
"underline" : 0
},
"text" : “200 mm”,
"type": "TEXT",
"x" : Xpos,
"y" : Ypos
})
EDIT: The text width also doesn’t seem to correspond with width of shape widgets, where a shape of width 3000 can be same in width with a text widget of width 300 for example
So my question is, if there is a possibility for the text to automatically appear on 1 line, if not, which width attribute should I target, and what are the differences between these 2
Best answer by Max Harper
View original