Files
gio/op/clip/shapes_test.go
T
Pierre Curto 6bfd980044 op/clip: don't panic on zero-sized Ellipse
When the rectangle used in an Ellipse has no width
or height, the path would panic with "path not closed".
Use an empty rectangle path in that case instead.

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
2021-11-16 15:50:53 +01:00

19 lines
313 B
Go

package clip_test
import (
"image/color"
"testing"
"gioui.org/f32"
"gioui.org/op"
"gioui.org/op/clip"
"gioui.org/op/paint"
)
func TestZeroEllipse(t *testing.T) {
p := f32.Pt(1.0, 2.0)
e := clip.Ellipse{Min: p, Max: p}
ops := new(op.Ops)
paint.FillShape(ops, color.NRGBA{R: 255, A: 255}, e.Op(ops))
}