mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
op/clip: automatically close Path in Outlines
Unclosed path segments in Path will be automatically closed by a line. Fixes: https://todo.sr.ht/~eliasnaur/gio/320 Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -15,17 +15,6 @@ import (
|
||||
)
|
||||
|
||||
func TestPathOutline(t *testing.T) {
|
||||
t.Run("unclosed path", func(t *testing.T) {
|
||||
defer func() {
|
||||
if err := recover(); err == nil {
|
||||
t.Error("Outline of an open path didn't panic")
|
||||
}
|
||||
}()
|
||||
var p clip.Path
|
||||
p.Begin(new(op.Ops))
|
||||
p.Line(f32.Pt(10, 10))
|
||||
clip.Outline{Path: p.End()}.Op()
|
||||
})
|
||||
t.Run("closed path", func(t *testing.T) {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user