mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 02:45:38 +00:00
op/clip: add bounds expansion after move
After moving the pen, the next action should update the bounds for the start position. References: https://todo.sr.ht/~eliasnaur/gio/451 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
This commit is contained in:
committed by
Elias Naur
parent
ba82ae46d0
commit
0c145b3815
+6
-3
@@ -214,8 +214,9 @@ func (p *Path) LineTo(to f32.Point) {
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[0:], uint32(p.contour))
|
||||
p.cmd(data[4:], scene.Line(p.pen, to))
|
||||
p.pen = to
|
||||
p.expand(p.pen)
|
||||
p.expand(to)
|
||||
p.pen = to
|
||||
}
|
||||
|
||||
func (p *Path) cmd(data []byte, c scene.Command) {
|
||||
@@ -263,9 +264,10 @@ func (p *Path) QuadTo(ctrl, to f32.Point) {
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[0:], uint32(p.contour))
|
||||
p.cmd(data[4:], scene.Quad(p.pen, ctrl, to))
|
||||
p.pen = to
|
||||
p.expand(p.pen)
|
||||
p.expand(ctrl)
|
||||
p.expand(to)
|
||||
p.pen = to
|
||||
}
|
||||
|
||||
// ArcTo adds an elliptical arc to the path. The implied ellipse is defined
|
||||
@@ -307,10 +309,11 @@ func (p *Path) CubeTo(ctrl0, ctrl1, to f32.Point) {
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[0:], uint32(p.contour))
|
||||
p.cmd(data[4:], scene.Cubic(p.pen, ctrl0, ctrl1, to))
|
||||
p.pen = to
|
||||
p.expand(p.pen)
|
||||
p.expand(ctrl0)
|
||||
p.expand(ctrl1)
|
||||
p.expand(to)
|
||||
p.pen = to
|
||||
}
|
||||
|
||||
// Close closes the path contour.
|
||||
|
||||
Reference in New Issue
Block a user