From aca566b5f4307bc4bfb3754dbc1a22ec5c0d4b77 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Jul 2022 15:17:41 +0200 Subject: [PATCH] final textbox push --- src/js/whiteboard.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/whiteboard.js b/src/js/whiteboard.js index 37fec0e..6ee6531 100644 --- a/src/js/whiteboard.js +++ b/src/js/whiteboard.js @@ -1053,14 +1053,22 @@ const whiteboard = { var textBoxPosition = textBox.position(); _this.sendFunction({ t: "setTextboxPosition", - d: [txId, textBoxPosition.top, textBoxPosition.left], + d: [ + txId, + textBoxPosition.top - _this.viewCoords.y, + textBoxPosition.left - _this.viewCoords.x, + ], }); }, drag: function () { var textBoxPosition = textBox.position(); _this.sendFunction({ t: "setTextboxPosition", - d: [txId, textBoxPosition.top, textBoxPosition.left], + d: [ + txId, + textBoxPosition.top - _this.viewCoords.y, + textBoxPosition.left - _this.viewCoords.x, + ], }); }, });