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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3150>
(cherry picked from commit d0b2351036)
This commit is contained in:
Florian Müllner 2024-01-29 17:29:51 +01:00
parent b7ddc8527f
commit 95a2ea93ad

View file

@ -438,13 +438,13 @@ var 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;