mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 19:05:35 +00:00
op/clip: add Circle and Path.CubeTo
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
+7
-4
@@ -294,12 +294,15 @@ func (p *Path) arc(alpha float64, c f32.Point, rx, ry, beg, delta float64) {
|
||||
// Cube records a cubic Bézier from the pen through
|
||||
// two control points ending in to.
|
||||
func (p *Path) Cube(ctrl0, ctrl1, to f32.Point) {
|
||||
if ctrl0 == (f32.Point{}) && ctrl1 == (f32.Point{}) && to == (f32.Point{}) {
|
||||
p.CubeTo(p.pen.Add(ctrl0), p.pen.Add(ctrl1), p.pen.Add(to))
|
||||
}
|
||||
|
||||
// CubeTo records a cubic Bézier from the pen through
|
||||
// two control points ending in to, with absolute coordinates.
|
||||
func (p *Path) CubeTo(ctrl0, ctrl1, to f32.Point) {
|
||||
if ctrl0 == p.pen && ctrl1 == p.pen && to == p.pen {
|
||||
return
|
||||
}
|
||||
ctrl0 = ctrl0.Add(p.pen)
|
||||
ctrl1 = ctrl1.Add(p.pen)
|
||||
to = to.Add(p.pen)
|
||||
data := p.ops.Write(scene.CommandSize + 4)
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[0:], uint32(p.contour))
|
||||
|
||||
Reference in New Issue
Block a user