From 9f9c70af201de845c104abf8281359cef8ed9bf9 Mon Sep 17 00:00:00 2001 From: copystring Date: Sun, 14 Dec 2025 00:21:51 +0100 Subject: [PATCH 1/2] Revert "fix(#960): wrap app_goto_target coordinates in array (#962)" This reverts commit 8d2b8de91d0764b133b75fc070187ee2981ee9ad. --- src/lib/socketHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/socketHandler.ts b/src/lib/socketHandler.ts index d0fab3d755..3c47db6122 100644 --- a/src/lib/socketHandler.ts +++ b/src/lib/socketHandler.ts @@ -189,7 +189,7 @@ export class socketHandler { const handler = this.adapter.deviceFeatureHandlers.get(duid); if (!handler) throw new Error(`No handler for DUID ${duid}`); - await this.adapter.requestsHandler.command(handler, duid, "app_goto_target", [points]); + await this.adapter.requestsHandler.command(handler, duid, "app_goto_target", points); return { result: "ok" }; } From 0c12ce98c185dc830a4878da6ba1b531ff907e12 Mon Sep 17 00:00:00 2001 From: copystring Date: Sun, 14 Dec 2025 00:40:44 +0100 Subject: [PATCH 2/2] fix(map): remove double padding in coordinate conversion --- src/www/map.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/www/map.ts b/src/www/map.ts index 57cf4eb3c7..41ac7cb8cf 100644 --- a/src/www/map.ts +++ b/src/www/map.ts @@ -891,7 +891,7 @@ class MapApplication { d.x = newX; d.y = newY; const element = event.sourceEvent.target.closest("g.zone"); - if (element) d3.select(element).attr("transform", `translate(${d.x - this.mapMinX}, ${d.y - this.mapMinY})`); + if (element) d3.select(element).attr("transform", `translate(${d.x}, ${d.y})`); }) .on("end", (event: any) => { const element = event.sourceEvent.target.closest("g.zone"); @@ -931,7 +931,7 @@ class MapApplication { enterGroup.append("rect").attr("class", "zone-rect").attr("x", 0).attr("y", 0).style("stroke-width", this.rescaler.zoneStrokeWidth()); enterGroup.append("circle").attr("class", "zone-handle").attr("r", this.rescaler.zoneHandleRadius()).call(resizeHandler as any); const mergedSelection = selection.merge(enterGroup as any); - mergedSelection.attr("transform", (d: Rect) => `translate(${d.x - this.mapMinX}, ${d.y - this.mapMinY})`); + mergedSelection.attr("transform", (d: Rect) => `translate(${d.x}, ${d.y})`); mergedSelection .select("rect") .attr("width", (d: Rect) => d.width) @@ -1059,7 +1059,7 @@ class MapApplication { if (this.mapMinX === undefined || this.mapMinY === undefined) return { x: 0, y: 0 }; const transform = d3.zoomTransform(this.svgContainer.node() as Element); const inverted = transform.invert([x, y]); - return { x: inverted[0] + this.mapMinX, y: inverted[1] + this.mapMinY }; + return { x: inverted[0], y: inverted[1] }; } private worldToSvgCoords(x: number, y: number): Point { @@ -1211,8 +1211,8 @@ class MapApplication { const params = this.getMapParams(); if (!this.currentRobotDuid || !params) return; const [mouseX, mouseY] = d3.pointer(event, this.mainGroup.node()); - const worldX = mouseX + this.mapMinX; - const worldY = mouseY + this.mapMinY; + const worldX = mouseX; + const worldY = mouseY; const point = localCoordsToRobotCoords({ x: worldX, y: worldY }, params); this.connection.sendTo(this.instanceId, "app_goto_target", { points: [point.x, point.y], duid: this.currentRobotDuid }); pin.style("opacity", 1.0);