have another try, but ignore your earlier attempts, to jog your memory this is the…
- User
have another try, but ignore your earlier attempts, to jog your memory this is the current code to resize a circle table
resizeTable() { const seats = this.instance.seats; const total = seats.length; const r = (total * 10 + 18) / 2 > 60 ? (total * 10 + 18) / 2 : 60; const x = this.instance.x; const y = this.instance.y; const alpha = (2 * Math.PI) / total; const w = 42; seats.forEach((seat: any, i: number) => { const xxx = x + (r + (w + 8) / 2) * Math.sin(Math.PI - alpha * i); const yyy = y + (r + (w + 8) / 2) * Math.cos(Math.PI - alpha * i); seat.seatObject.set('x', xxx); seat.seatObject.set('y', yyy); seat.seatObject.set('left', xxx); seat.seatObject.set('top', yyy); }); // @ts-ignore this.instance._objects[0].radius = r; // set the size of the table this.instance._objects[0].set('width', r * 2 + 100); this.instance._objects[0].set('height', r * 2 + 100); this.instance.set('width', r * 2 + 100); this.instance.set('height', r * 2 + 100); this.instance.setCoords(); this.instance.canvas.renderAll(); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.