This commit is contained in:
Alexander Wang 2023-02-09 14:16:20 -08:00
parent ad24108446
commit 8736a16f8f
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
2 changed files with 1 additions and 7 deletions

View file

@ -129,11 +129,6 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape {
shape.Color = text.GetColor(theme, shape.Italic) shape.Color = text.GetColor(theme, shape.Italic)
applyStyles(shape, obj) applyStyles(shape, obj)
if obj.IsSequenceDiagramGroup() {
shape.StrokeWidth = 0
shape.Blend = true
}
switch obj.Attributes.Shape.Value { switch obj.Attributes.Shape.Value {
case d2target.ShapeCode, d2target.ShapeText: case d2target.ShapeCode, d2target.ShapeText:
shape.Language = obj.Attributes.Language shape.Language = obj.Attributes.Language

View file

@ -986,12 +986,11 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske
fontColor = targetShape.Color fontColor = targetShape.Color
} }
textStyle := fmt.Sprintf("text-anchor:%s;font-size:%vpx;fill:%s", "middle", targetShape.FontSize, fontColor) textStyle := fmt.Sprintf("text-anchor:%s;font-size:%vpx;fill:%s", "middle", targetShape.FontSize, fontColor)
x := labelTL.X + float64(targetShape.LabelWidth)/2. x := labelTL.X + float64(targetShape.LabelWidth)/2.
// text is vertically positioned at its baseline which is at labelTL+FontSize // text is vertically positioned at its baseline which is at labelTL+FontSize
y := labelTL.Y + float64(targetShape.FontSize) y := labelTL.Y + float64(targetShape.FontSize)
// background does not exist for <text>, so draw a rectangle behind it // background style does not exist for <text>, so draw a rectangle behind it to emulate
if targetShape.LabelFill != "" { if targetShape.LabelFill != "" {
fmt.Fprintf(writer, `<rect x="%f" y="%f" width="%d" height="%d" fill="%s"></rect>`, fmt.Fprintf(writer, `<rect x="%f" y="%f" width="%d" height="%d" fill="%s"></rect>`,
labelTL.X, labelTL.Y, labelTL.X, labelTL.Y,