slider: Include handle border radius when calculating center offset

Since 38da479ee we correctly ceil the non-integer radius of the slider
handle when calculating the offset for drawing the circle. Since the
handle also has a border with a width of 1px by default, we should also
factor that in when calculating the offset.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569
This commit is contained in:
Jonas Dreßler 2020-03-01 14:01:14 +01:00 committed by Florian Müllner
parent e22421a25a
commit 3ddae9d815

View File

@ -43,10 +43,10 @@ var Slider = GObject.registerClass({
let [hasHandleColor, handleBorderColor] = let [hasHandleColor, handleBorderColor] =
themeNode.lookup_color('-slider-handle-border-color', false); themeNode.lookup_color('-slider-handle-border-color', false);
let wholeHandleRadius = Math.ceil(handleRadius); const ceiledHandleRadius = Math.ceil(handleRadius + handleBorderWidth);
let handleX = wholeHandleRadius + const handleX = ceiledHandleRadius +
(width - 2 * wholeHandleRadius) * this._value / this._maxValue; (width - 2 * ceiledHandleRadius) * this._value / this._maxValue;
let handleY = height / 2; const handleY = height / 2;
let color = themeNode.get_foreground_color(); let color = themeNode.get_foreground_color();
Clutter.cairo_set_source_color(cr, color); Clutter.cairo_set_source_color(cr, color);