op/clip: specify path for stroked Rects

Fixes: https://todo.sr.ht/~eliasnaur/gio/358
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-10 18:59:47 +01:00
parent 242045f662
commit ce116abded
3 changed files with 42 additions and 0 deletions
+14
View File
@@ -277,3 +277,17 @@ func TestPathInterleave(t *testing.T) {
paint.ColorOp{}.Add(ops)
})
}
func TestStrokedRect(t *testing.T) {
run(t, func(o *op.Ops) {
r := clip.Rect{Min: image.Pt(50, 50), Max: image.Pt(100, 100)}
paint.FillShape(o,
color.NRGBA{R: 0xff, A: 0xFF},
clip.Stroke{
Path: r.Path(),
Width: 5,
}.Op(),
)
}, func(r result) {
})
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B