scrollbar: roundrect knob when browser supports it

This commit is contained in:
jean-emmanuel 2025-09-22 11:38:11 +02:00
parent 4c754bfaf4
commit 9c5ad33944

View file

@ -228,7 +228,11 @@ export default class Scrollbar extends StaticProperties(Fader, {
this.ctx.beginPath()
d = d / (height - this.gaugePadding) * (height-this.gaugePadding - knobHeight)
this.ctx.rect(this.gaugePadding, d, width - this.gaugePadding * 2, knobHeight)
if (this.ctx.roundRect) {
this.ctx.roundRect(this.gaugePadding, d, width - this.gaugePadding * 2, knobHeight, PXSCALE * this.cssVars.borderRadius)
} else {
this.ctx.rect(this.gaugePadding, d, width - this.gaugePadding * 2, knobHeight)
}
this.ctx.fill()
let x, y, w, h,