From 2aef871d5d7a58428468a59ca73d701244abf4c4 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 2 Oct 2025 18:55:48 +0200 Subject: [PATCH] [Editor] Make sure the comment dialog always have relative coordinates between 0% and 100% This way, when the window is resized, the dialog stay visible. --- web/comment_manager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/comment_manager.js b/web/comment_manager.js index b6f360388..4add97b73 100644 --- a/web/comment_manager.js +++ b/web/comment_manager.js @@ -854,8 +854,9 @@ class CommentDialog { posY = 0; } } - posX /= innerWidth; - posY /= innerHeight; + + posX = MathClamp(posX / innerWidth, 0, 1); + posY = MathClamp(posY / innerHeight, 0, 1); this.#setPosition(posX, posY); await this.#overlayManager.open(this.#dialog);