diff --git a/op/clip/clip.go b/op/clip/clip.go index 2d9a9ba08..279077eaf 100644 --- a/op/clip/clip.go +++ b/op/clip/clip.go @@ -204,6 +204,9 @@ func (p *Path) Line(delta f32.Point) { // LineTo moves the pen to the absolute point specified, recording a line. func (p *Path) LineTo(to f32.Point) { + if to == p.pen { + return + } data := ops.WriteMulti(p.ops, scene.CommandSize+4) bo := binary.LittleEndian bo.PutUint32(data[0:], uint32(p.contour)) @@ -250,6 +253,9 @@ func (p *Path) Quad(ctrl, to f32.Point) { // QuadTo records a quadratic Bézier from the pen to end // with the control point ctrl, with absolute coordinates. func (p *Path) QuadTo(ctrl, to f32.Point) { + if ctrl == p.pen && to == p.pen { + return + } data := ops.WriteMulti(p.ops, scene.CommandSize+4) bo := binary.LittleEndian bo.PutUint32(data[0:], uint32(p.contour))