[Seating Chart] - Changing size of Viewbox while dragging


#1

I know this block of code for size of guest rectangle

      $(go.Panel, "Viewbox",
        { desiredSize: new go.Size(50, 38) },
        $(go.TextBlock, { margin: 2, desiredSize: new go.Size(55, NaN), font: "8pt Verdana, sans-serif", textAlign: "center", stroke: "darkblue" },
          new go.Binding("text", "", function(data) {
            var s = data.key;
            if (data.plus) s += " +" + data.plus.toString();
            return s;
          }))
      )

I want to change size of guest once drag to another canvas (main diagram) and back to original size if drag back to canvas of guest.
Thanks in advanced.


#2

What size do you want the text to be? You could remove the “Viewbox” Panel from around the TextBlock and set its desiredSize.


#3

Dear @walter,
I want it to be smaller, circle and fit to a seat. However still be big size if drag drop in left side (canvas).


#4

Is there a reason you cannot modify the code to specify a smaller desiredSize?


#5

Dear @walter,
I don’t know where event of drawing worker in right canvas is.
My purpose is just changing size of worker once dragging to right side canvas, not for all of situations.


#6

Have you tried changing the Diagram.scale of the Palette?


#7

Dear @walter,
Not yet, I’ll try this.
Could you give me reference of this?