In the group there’s square rectangle nodes. Inside the rectangle there’s two textblocks one in the center and one in the topleft. I am using rotate multiple tool to rotate group and nodes. I need to skip rotating the textblocks inside the nodes. Nodes should always align with the group while the texts should always remain at angle 0. ideally also the topleft textblock should always remain at the topleft even though the rectangle is rotated. Here’s my node and group code :
let _0degreeNodeTemplate =
$(go.Node, "Auto",
{
rotatable: false,
deletable: false,
locationSpot: new go.Spot(0, 0, 0, 0),
dragComputation: scope.stayInGroup,
movable: true,
canMove: false,
margin: 1
},
new go.Binding("location", "loc").makeTwoWay(),
new go.Binding("angle", "angle").makeTwoWay(),
$(go.Panel, "Auto", { name: "NODE_RECTANGLE" },
$(go.Shape, "Rectangle", {
toMaxLinks: 1,
fromMaxLinks: 1,
width: 75,
height: 75,
stroke: "black",
strokeWidth: 1,
fromSpot: go.Spot.TopSide,
toSpot: go.Spot.TopSide,
portId: "",
cursor: "pointer",
fromLinkable: true, fromLinkableSelfNode: false, fromLinkableDuplicates: false,
toLinkable: true, toLinkableSelfNode: false, toLinkableDuplicates: false
}, new go.Binding("fill", "color"),
),
$(go.TextBlock, "Default text", { margin: 6, font: "bold 18px sans-serif" },
new go.Binding("text", "name").makeTwoWay()),
$(go.TextBlock, "Default text", { name:"TEXT_BLOCK", margin: 6, alignment: go.Spot.TopLeft, font: "10px sans-serif" },
new go.Binding("text", "ID_COLONNE").makeTwoWay()),
)
);
let _0degreeGroupTemplate =
$(go.Group, "Auto",
{
rotatable: true,
locationSpot: go.Spot.Center,
rotateObjectName: "GROUP_RECTANGLE",
resizable: false,
}, new go.Binding("location", "loc").makeTwoWay(),
$(go.Panel, "Auto", { name: "GROUP_RECTANGLE" },
$(go.Shape, "Rectangle", { name: "SHAPE", parameter1: 10, height: 85 + 20, fill: "lightyellow" },
new go.Binding("width", "nodeCount", function (v) { return v * 75 + 50; })),
$(go.Shape, "TopFrontSide", { name: "FRONTLINE", parameter1: 10, strokeWidth: 2, height: 85 + 20 },
new go.Binding("stroke", "frontcolor"), new go.Binding("width", "nodeCount", function (v) { return v * 75 + 50; })),
$(go.TextBlock, { margin: 5, alignment: go.Spot.TopLeft, font: "Bold 12pt Sans-Sherif", width: 20 }, new go.Binding("text", "key")),
$(go.Placeholder, { padding: 5 }),
new go.Binding("angle", "angle").makeTwoWay()
)
);