diff -r adb44a2d8226 -r 5c941f5deeec tools/map_templates_tool/main.qml --- a/tools/map_templates_tool/main.qml Fri Nov 29 22:29:58 2024 +0100 +++ b/tools/map_templates_tool/main.qml Sun Dec 01 21:08:03 2024 +0100 @@ -20,7 +20,7 @@ Rectangle { id: mapContainer - property int spaceForCode: Math.max(200, parent.height / 2) + property int spaceForCode: Math.max(250, parent.height * 0.6) property int mapWidth: 2048 property int mapHeight: 1024 property real aspectRatio: mapWidth / mapHeight @@ -41,6 +41,16 @@ anchors.fill: mapContainer } + MouseArea { + id: mouseArea + anchors.fill: mapContainer + hoverEnabled: true + } + + Label { + text: mouseArea.containsMouse ? "(%1, %2)".arg(Math.floor(mouseArea.mouseX / mouseArea.width * mapContainer.mapWidth)).arg(Math.floor(mouseArea.mouseY / mouseArea.height * mapContainer.mapHeight)) : "" + } + Rectangle { anchors.fill: codeInput color: "gray" @@ -119,8 +129,8 @@ newKey = "outline_points" } - if (line === " holes:") { - newKey = "holes" + if (line === " walls:") { + newKey = "walls" } if (line === " fill_points:") { @@ -243,6 +253,6 @@ } function renderTemplate(template) { - return polygons2shapes(template.outline_points, "red", "black").concat(polygons2shapes(template.holes, "gray", "gray")) + return polygons2shapes(template.outline_points, "red", "black").concat(polygons2shapes(template.walls, "gray", "gray")) } }