This commit is contained in:
Alexander Wang 2023-03-14 00:11:41 -07:00
parent b4f711c93d
commit f8a1653e86
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
3 changed files with 203 additions and 0 deletions

View file

@ -98,6 +98,7 @@ func Rect(r *Runner, shape d2target.Shape) (string, error) {
pathEl := d2themes.NewThemableElement("path") pathEl := d2themes.NewThemableElement("path")
pathEl.SetTranslate(float64(shape.Pos.X), float64(shape.Pos.Y)) pathEl.SetTranslate(float64(shape.Pos.X), float64(shape.Pos.Y))
pathEl.Fill, pathEl.Stroke = d2themes.ShapeTheme(shape) pathEl.Fill, pathEl.Stroke = d2themes.ShapeTheme(shape)
pathEl.FillPattern = shape.FillPattern
pathEl.ClassName = "shape" pathEl.ClassName = "shape"
pathEl.Style = shape.CSSStyle() pathEl.Style = shape.CSSStyle()
for _, p := range paths { for _, p := range paths {
@ -145,6 +146,7 @@ func DoubleRect(r *Runner, shape d2target.Shape) (string, error) {
pathEl := d2themes.NewThemableElement("path") pathEl := d2themes.NewThemableElement("path")
pathEl.SetTranslate(float64(shape.Pos.X), float64(shape.Pos.Y)) pathEl.SetTranslate(float64(shape.Pos.X), float64(shape.Pos.Y))
pathEl.Fill, pathEl.Stroke = d2themes.ShapeTheme(shape) pathEl.Fill, pathEl.Stroke = d2themes.ShapeTheme(shape)
pathEl.FillPattern = shape.FillPattern
pathEl.ClassName = "shape" pathEl.ClassName = "shape"
pathEl.Style = shape.CSSStyle() pathEl.Style = shape.CSSStyle()
for _, p := range pathsBigRect { for _, p := range pathsBigRect {

View file

@ -1058,6 +1058,58 @@ something
} }
`, `,
}, },
{
name: "dots",
script: `
NETWORK: {
style: {
stroke: black
fill-pattern: dots
double-border: true
fill: "#E7E9EE"
font: mono
}
CELL TOWER: {
style: {
stroke: black
fill-pattern: dots
fill: "#F5F6F9"
font: mono
}
satellites: SATELLITES {
shape: stored_data
style: {
font: mono
fill: white
stroke: black
multiple: true
}
}
transmitter: TRANSMITTER {
style: {
font: mono
fill: white
stroke: black
}
}
satellites -> transmitter: SEND {
style.stroke: black
style.font: mono
}
satellites -> transmitter: SEND {
style.stroke: black
style.font: mono
}
satellites -> transmitter: SEND {
style.stroke: black
style.font: mono
}
}
}
`,
},
} }
runa(t, tcs) runa(t, tcs)
} }

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 316 KiB