mantab chatgot

This commit is contained in:
zadit frontend
2024-07-31 17:33:09 +00:00
parent a768324553
commit 4a891598fd

View File

@@ -7,7 +7,6 @@ const getTables = async (cafeId) => {
{ tableId: 2, xposition: 30, yposition: 1, cafeId: 5, tableNo: 2 }, { tableId: 2, xposition: 30, yposition: 1, cafeId: 5, tableNo: 2 },
{ tableId: 3, xposition: 50, yposition: 70, cafeId: 5, tableNo: 3 }, { tableId: 3, xposition: 50, yposition: 70, cafeId: 5, tableNo: 3 },
{ tableId: 4, xposition: 200, yposition: 70, cafeId: 5, tableNo: 4 }, { tableId: 4, xposition: 200, yposition: 70, cafeId: 5, tableNo: 4 },
{ tableId: 5, xposition: -200, yposition: 70, cafeId: 5, tableNo: 4 },
]; ];
}; };
@@ -86,14 +85,17 @@ const TableCanvas = () => {
yposition: (table.yposition - minY) * scale + padding, yposition: (table.yposition - minY) * scale + padding,
})); }));
// Draw the tables as rectangles and print table numbers // Draw the tables as rectangles first
scaledTables.forEach((table) => { scaledTables.forEach((table) => {
context.beginPath(); context.beginPath();
context.rect(table.xposition, table.yposition, rectWidth, rectHeight); context.rect(table.xposition, table.yposition, rectWidth, rectHeight);
context.fillStyle = "blue"; context.fillStyle = "blue";
context.fill(); context.fill();
context.stroke(); context.stroke();
});
// Then draw the table numbers on top
scaledTables.forEach((table) => {
context.font = "12px Arial"; context.font = "12px Arial";
context.fillStyle = "white"; context.fillStyle = "white";
context.textAlign = "center"; context.textAlign = "center";