swf2ass-go/types/shapes/DrawPath.go

37 lines
837 B
Go
Raw Normal View History

package shapes
2023-11-20 05:20:31 +00:00
import "git.gammaspectra.live/WeebDataHoarder/swf2ass-go/types/math"
2023-11-20 05:20:31 +00:00
type DrawPath struct {
Style StyleRecord
Shape Shape
2023-11-20 05:20:31 +00:00
}
2023-11-20 06:32:13 +00:00
func (p DrawPath) ApplyMatrixTransform(transform math.MatrixTransform, applyTranslation bool) (r DrawPath) {
return DrawPath{
2023-11-29 00:04:52 +00:00
Style: p.Style.ApplyMatrixTransform(transform, applyTranslation),
Shape: p.Shape.ApplyMatrixTransform(transform, applyTranslation),
}
}
2023-11-24 08:59:01 +00:00
func (p DrawPath) ApplyColorTransform(transform math.ColorTransform) (r DrawPath) {
return DrawPath{
Style: p.Style.ApplyColorTransform(transform),
Shape: p.Shape,
2023-11-24 08:59:01 +00:00
}
}
func DrawPathFill(record *FillStyleRecord, shape Shape) DrawPath {
2023-11-20 06:32:13 +00:00
return DrawPath{
Style: record,
Shape: shape,
2023-11-20 06:32:13 +00:00
}
}
func DrawPathStroke(record *LineStyleRecord, shape Shape) DrawPath {
2023-11-20 06:32:13 +00:00
return DrawPath{
Style: record,
Shape: shape,
2023-11-20 06:32:13 +00:00
}
}