save
This commit is contained in:
parent
48593357a5
commit
6d7188a3c8
3 changed files with 71 additions and 4 deletions
|
|
@ -155,6 +155,8 @@ func DoubleRect(r *Runner, shape d2target.Shape) (string, error) {
|
||||||
pathEl = d2themes.NewThemableElement("path")
|
pathEl = d2themes.NewThemableElement("path")
|
||||||
pathEl.SetTranslate(float64(shape.Pos.X+d2target.INNER_BORDER_OFFSET), float64(shape.Pos.Y+d2target.INNER_BORDER_OFFSET))
|
pathEl.SetTranslate(float64(shape.Pos.X+d2target.INNER_BORDER_OFFSET), float64(shape.Pos.Y+d2target.INNER_BORDER_OFFSET))
|
||||||
pathEl.Fill, pathEl.Stroke = d2themes.ShapeTheme(shape)
|
pathEl.Fill, pathEl.Stroke = d2themes.ShapeTheme(shape)
|
||||||
|
// No need for inner to double paint
|
||||||
|
pathEl.Fill = "transparent"
|
||||||
pathEl.ClassName = "shape"
|
pathEl.ClassName = "shape"
|
||||||
pathEl.Style = shape.CSSStyle()
|
pathEl.Style = shape.CSSStyle()
|
||||||
for _, p := range pathsSmallRect {
|
for _, p := range pathsSmallRect {
|
||||||
|
|
@ -162,10 +164,16 @@ func DoubleRect(r *Runner, shape d2target.Shape) (string, error) {
|
||||||
output += pathEl.Render()
|
output += pathEl.Render()
|
||||||
}
|
}
|
||||||
|
|
||||||
output += fmt.Sprintf(
|
sketchOEl := d2themes.NewThemableElement("rect")
|
||||||
`<rect class="sketch-overlay" transform="translate(%d %d)" width="%d" height="%d" />`,
|
sketchOEl.SetTranslate(float64(shape.Pos.X), float64(shape.Pos.Y))
|
||||||
shape.Pos.X, shape.Pos.Y, shape.Width, shape.Height,
|
sketchOEl.Width = float64(shape.Width)
|
||||||
)
|
sketchOEl.Height = float64(shape.Height)
|
||||||
|
renderedSO, err := d2themes.NewThemableSketchOverlay(sketchOEl, pathEl.Fill).Render()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
output += renderedSO
|
||||||
|
|
||||||
return output, nil
|
return output, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -986,6 +986,23 @@ company Warehouse.explanation: |md
|
||||||
- Staging
|
- Staging
|
||||||
- Dispatch to Site
|
- Dispatch to Site
|
||||||
|
|
|
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "double-border",
|
||||||
|
script: `a: {
|
||||||
|
style.double-border: true
|
||||||
|
b
|
||||||
|
}
|
||||||
|
c: {
|
||||||
|
shape: oval
|
||||||
|
style.double-border: true
|
||||||
|
d
|
||||||
|
}
|
||||||
|
normal: {
|
||||||
|
nested normal
|
||||||
|
}
|
||||||
|
something
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
42
d2renderers/d2sketch/testdata/double-border/sketch.exp.svg
vendored
Normal file
42
d2renderers/d2sketch/testdata/double-border/sketch.exp.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 270 KiB |
Loading…
Reference in a new issue