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>
This commit is contained in:
parent
4e70315fbb
commit
d0b2351036
@ -446,13 +446,13 @@ export const BoxPointer = GObject.registerClass({
|
|||||||
() => (this._sourceActor = null), this);
|
() => (this._sourceActor = null), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._arrowAlignment = alignment;
|
this._arrowAlignment = Math.clamp(alignment, 0.0, 1.0);
|
||||||
|
|
||||||
this.queue_relayout();
|
this.queue_relayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
setSourceAlignment(alignment) {
|
setSourceAlignment(alignment) {
|
||||||
this._sourceAlignment = alignment;
|
this._sourceAlignment = Math.clamp(alignment, 0.0, 1.0);
|
||||||
|
|
||||||
if (!this._sourceActor)
|
if (!this._sourceActor)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user