2023-11-21 01:55:09 +00:00
|
|
|
package shapes
|
2023-11-20 05:20:31 +00:00
|
|
|
|
2023-11-24 04:02:08 +00:00
|
|
|
import "git.gammaspectra.live/WeebDataHoarder/swf2ass-go/types/math"
|
|
|
|
|
2023-11-20 05:20:31 +00:00
|
|
|
type DrawPath struct {
|
2023-11-26 21:45:07 +00:00
|
|
|
Style StyleRecord
|
|
|
|
Shape Shape
|
2023-11-20 05:20:31 +00:00
|
|
|
}
|
2023-11-20 06:32:13 +00:00
|
|
|
|
2023-11-24 04:02:08 +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),
|
2023-11-26 21:45:07 +00:00
|
|
|
Shape: p.Shape.ApplyMatrixTransform(transform, applyTranslation),
|
2023-11-24 04:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-24 08:59:01 +00:00
|
|
|
func (p DrawPath) ApplyColorTransform(transform math.ColorTransform) (r DrawPath) {
|
|
|
|
return DrawPath{
|
2023-11-26 21:45:07 +00:00
|
|
|
Style: p.Style.ApplyColorTransform(transform),
|
|
|
|
Shape: p.Shape,
|
2023-11-24 08:59:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-26 21:45:07 +00:00
|
|
|
func DrawPathFill(record *FillStyleRecord, shape Shape) DrawPath {
|
2023-11-20 06:32:13 +00:00
|
|
|
return DrawPath{
|
2023-11-26 21:45:07 +00:00
|
|
|
Style: record,
|
|
|
|
Shape: shape,
|
2023-11-20 06:32:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-26 21:45:07 +00:00
|
|
|
func DrawPathStroke(record *LineStyleRecord, shape Shape) DrawPath {
|
2023-11-20 06:32:13 +00:00
|
|
|
return DrawPath{
|
2023-11-26 21:45:07 +00:00
|
|
|
Style: record,
|
|
|
|
Shape: shape,
|
2023-11-20 06:32:13 +00:00
|
|
|
}
|
|
|
|
}
|