op/clip: don't panic when stroking empty path

Fixes: https://todo.sr.ht/~eliasnaur/gio/367
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-22 12:04:10 +01:00
parent e9e00994cf
commit 773a7e48a0
2 changed files with 25 additions and 11 deletions
+10
View File
@@ -62,6 +62,16 @@ func TestTransformChecks(t *testing.T) {
st.Pop()
}
func TestEmptyPath(t *testing.T) {
var ops op.Ops
p := clip.Path{}
p.Begin(&ops)
defer clip.Stroke{
Path: p.End(),
Width: 3,
}.Op().Push(&ops).Pop()
}
func newWindow(t testing.TB, width, height int) *headless.Window {
w, err := headless.NewWindow(width, height)
if err != nil {