Skip to content

Commit 2aef871

Browse files
committed
[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.
1 parent 7fa5071 commit 2aef871

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

web/comment_manager.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,9 @@ class CommentDialog {
854854
posY = 0;
855855
}
856856
}
857-
posX /= innerWidth;
858-
posY /= innerHeight;
857+
858+
posX = MathClamp(posX / innerWidth, 0, 1);
859+
posY = MathClamp(posY / innerHeight, 0, 1);
859860
this.#setPosition(posX, posY);
860861

861862
await this.#overlayManager.open(this.#dialog);

0 commit comments

Comments
 (0)