From d0b23510367285753fb6cba9d47b452c995d0dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 29 Jan 2024 17:29:51 +0100 Subject: [PATCH] boxpointer: Clamp alignments to expected range The values are expected to be between 0 (start) and 1 (end), enforce that with appropriate clamp() calls. Part-of: --- js/ui/boxpointer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 8c410201e..de148fdd0 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -446,13 +446,13 @@ export const BoxPointer = GObject.registerClass({ () => (this._sourceActor = null), this); } - this._arrowAlignment = alignment; + this._arrowAlignment = Math.clamp(alignment, 0.0, 1.0); this.queue_relayout(); } setSourceAlignment(alignment) { - this._sourceAlignment = alignment; + this._sourceAlignment = Math.clamp(alignment, 0.0, 1.0); if (!this._sourceActor) return;