2023-11-21 01:55:09 +00:00
|
|
|
package shapes
|
|
|
|
|
|
|
|
import (
|
2023-12-02 01:15:21 +00:00
|
|
|
"git.gammaspectra.live/WeebDataHoarder/swf-go/types"
|
2023-11-21 01:55:09 +00:00
|
|
|
"git.gammaspectra.live/WeebDataHoarder/swf2ass-go/types/math"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ActivePath struct {
|
2023-11-24 08:59:01 +00:00
|
|
|
Segment PathSegment[types.Twip]
|
2023-11-21 01:55:09 +00:00
|
|
|
StyleId int
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewActivePath(styleId int, start math.Vector2[types.Twip]) *ActivePath {
|
|
|
|
return &ActivePath{
|
|
|
|
Segment: NewPathSegment(start),
|
|
|
|
StyleId: styleId,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-24 08:59:01 +00:00
|
|
|
func (p *ActivePath) AddPoint(point VisitedPoint[types.Twip]) {
|
2023-11-21 01:55:09 +00:00
|
|
|
p.Segment.AddPoint(point)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ActivePath) Flip() {
|
|
|
|
p.Segment.Flip()
|
|
|
|
}
|