slider: Use correct handle size when calculating rightmost position
Using the ceiled radius for calculating the rightmost position the handle can take on the slider was resulting in a small gap when the size was not an integer value since the radius used when drawing the handle is not ceiled. This effectively reverts38da479e
which seems to have been the wrong fix for the problem it was trying to solve. The problem presumably had been caused by not considering the border that the handle still had at that time. The border issue was then later fixed by3ddae9d8
, without reverting38da479e
. Then in6fd0aac8
support for drawing borders on the slider got dropped, including the changes from3ddae9d8
, leaving us with just the changes from38da479e
but now without borders on the handle. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8187 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3648>
This commit is contained in:
@ -48,11 +48,10 @@ export const Slider = GObject.registerClass({
|
|||||||
let [width, height] = this.get_surface_size();
|
let [width, height] = this.get_surface_size();
|
||||||
const rtl = this.get_text_direction() === Clutter.TextDirection.RTL;
|
const rtl = this.get_text_direction() === Clutter.TextDirection.RTL;
|
||||||
|
|
||||||
const ceiledHandleRadius = Math.ceil(this._handleRadius);
|
|
||||||
const handleY = height / 2;
|
const handleY = height / 2;
|
||||||
|
|
||||||
let handleX = ceiledHandleRadius +
|
let handleX = this._handleRadius +
|
||||||
(width - 2 * ceiledHandleRadius) * this._value / this._maxValue;
|
(width - 2 * this._handleRadius) * this._value / this._maxValue;
|
||||||
if (rtl)
|
if (rtl)
|
||||||
handleX = width - handleX;
|
handleX = width - handleX;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user