25 lines
383 B
Go
25 lines
383 B
Go
package svg
|
|
|
|
type (
|
|
Width struct {
|
|
*LengthAttr[WidthTag]
|
|
}
|
|
WidthP struct {
|
|
PercentageAttr[WidthTag]
|
|
}
|
|
|
|
WidthTag struct{}
|
|
)
|
|
|
|
func (l *Length) AsWidth() Width {
|
|
return Width{LengthAttr: (*LengthAttr[WidthTag])(l)}
|
|
}
|
|
|
|
func (p Percentage) AsWidth() WidthP {
|
|
return WidthP{PercentageAttr: (PercentageAttr[WidthTag])(p)}
|
|
}
|
|
|
|
func (WidthTag) PrintTag() string {
|
|
return "width"
|
|
}
|