On our node template we currently have an Auto panel consisting of a RoundedRectangle shape as the main object with a Table panel inside it. Within this table panel we declare 3 columns, on row 0 each column has a TextBlock element or TextBlock nested within a button. These TextBlock elements consist of a single character and have a custom font set to "900 3em serif"
allowing them to be much bolder and bigger than other text on the node template.
The second row has a single TextBlock spanning all three rows which does not have a customised font
The result of this is something looking like this:
The issue we now have is that we wish to add a shape to surround the last TextBlock element on the top row. I assumed this would be easily achieve by just adding an auto panel and shape. i.e. this code
$(go.TextBlock,
{
row: 0, column: 2, font: "900 3em serif", spacingBelow: -5,
flip: go.GraphObject.FlipHorizontal, stroke: cssStyles.foreground,
text: "¬"
}
)
by this code
$(go.Panel, "Auto",
{ row: 0, column: 2 },
$(go.Shape, "RoundedRectangle", { fill: "blue" }),
$(go.TextBlock,
{
font: "900 3em serif", spacingBelow: -5,
flip: go.GraphObject.FlipHorizontal, stroke: cssStyles.foreground,
text: "¬"
}
)
)
however the custom font seems to result in a background shape and fill that is both too narrow and too tall for the text within it.
If I remove the custom font it appears to work correctly
I’ve also tried putting the auto panel code directly inside the node template auto panel (in other words not inside the table panel) and I get the same result.
What is causing the blue shape I am trying to surround my TextBlock in to not grow/shrink to the right size for the TextBlock