op/clip: fix Path open state

If a Move/MoveTo did not move the pen, the Path
was still set as open.

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2021-12-02 11:03:24 +01:00
committed by Elias Naur
parent e6e69812af
commit 872b4ba41b
2 changed files with 32 additions and 10 deletions
+3
View File
@@ -154,6 +154,9 @@ func (p *Path) Move(delta f32.Point) {
// MoveTo moves the pen to the specified absolute coordinate.
func (p *Path) MoveTo(to f32.Point) {
if p.pen == to {
return
}
p.open = p.open || p.pen != p.start
p.end()
p.pen = to