summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js4
-rw-r--r--robot.js4
2 files changed, 2 insertions, 6 deletions
diff --git a/index.js b/index.js
index fef1073..5f4050d 100644
--- a/index.js
+++ b/index.js
@@ -48,7 +48,7 @@ const drawCross = (x, y) => {
canvas.addEventListener('mousedown', (e) => {
crosses.push({x: e.layerX - canvasOffsetX, y: e.layerY - canvasOffsetY});
- // moveTo((e.layerX - canvasOffsetX - canvas.width/2) * scale, (e.layerY - canvasOffsetY - canvas.height/2) * scale)
+ moveTo(-(e.layerX - canvasOffsetX - canvas.width/2) * scale, -(e.layerY - canvasOffsetY - canvas.height/2) * scale)
tr.a = Math.atan((-e.layerX + canvasOffsetX + canvas.width/2)/(e.layerY - canvasOffsetY - canvas.height/2))
if ( e.layerY - canvasOffsetY > canvas.height/2 )
@@ -124,4 +124,4 @@ const updateOnFrame = () => {
}
//updateOnFrame();
-window.onresize = update; \ No newline at end of file
+window.onresize = update;
diff --git a/robot.js b/robot.js
index f318441..11409c0 100644
--- a/robot.js
+++ b/robot.js
@@ -50,13 +50,9 @@ client.on('connect', () => {
console.log(client)
console.log('Connecté au courtier MQTT');
client.subscribe('move')
- moveTo(1000,1000)
});
// client.publish('move','ULT1')
-/* client.on('message', function (topic, message) {
- console.log('Received from ', topic, ' : ', message.toString());
-}); */
/* client.on('close', function () {
console.log('Déconnecté du courtier MQTT');