cleanup
This commit is contained in:
parent
ad24108446
commit
8736a16f8f
2 changed files with 1 additions and 7 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue