Ensure mask covers non-circular emoji

This commit is contained in:
Zach Fox 2019-08-15 13:20:09 -07:00
parent 9ae5eba12a
commit 0497c10d69

View file

@ -71,7 +71,9 @@ Item {
ctx.beginPath() ctx.beginPath()
ctx.fillStyle = root.colorCircle ctx.fillStyle = root.colorCircle
ctx.moveTo(x, y) ctx.moveTo(x, y)
ctx.arc(x, y, width / 2, start, end, false) // Using `width` instead of `width/2` as the argument here ensures
// that the ProgressCircle mask will cover the entirety of non-circular emoji.
ctx.arc(x, y, width, start, end, false)
ctx.lineTo(x, y) ctx.lineTo(x, y)
ctx.fill() ctx.fill()
} else { } else {
@ -88,6 +90,8 @@ Item {
ctx.strokeStyle = root.colorCircle ctx.strokeStyle = root.colorCircle
ctx.stroke() ctx.stroke()
} }
ctx.scale(0.1, 0.2);
} }
} }
} }