fix tooltip shadow
This commit is contained in:
parent
255d7724ef
commit
e7aa4f8d19
4 changed files with 18 additions and 10 deletions
|
|
@ -169,8 +169,10 @@ func generateTooltipLine(i, y int, text string, ruler *textmeasure.Ruler) (strin
|
||||||
|
|
||||||
dims := d2graph.GetTextDimensions(nil, ruler, mtext, nil)
|
dims := d2graph.GetTextDimensions(nil, ruler, mtext, nil)
|
||||||
|
|
||||||
// TODO box-shadow: 0px 0px 32px rgba(31, 36, 58, 0.1);
|
// filter: drop-shadow(0px 0px 32px #4444dd);
|
||||||
line := fmt.Sprintf(`<g transform="translate(%d %d)">%s</g>`,
|
// filter: drop-shadow(0px 0px 32px rgba(31, 36, 58, 0.1));
|
||||||
|
// TODO box-shadow: 0px 0px 32px rgba(31 36 58 0.1);
|
||||||
|
line := fmt.Sprintf(`<g transform="translate(%d %d)" class="tooltip-icon">%s</g>`,
|
||||||
0, y, generateNumberedIcon(i, 0, 0))
|
0, y, generateNumberedIcon(i, 0, 0))
|
||||||
|
|
||||||
line += fmt.Sprintf(`<text class="text" x="%d" y="%d" style="font-size: %dpx;">%s</text>`,
|
line += fmt.Sprintf(`<text class="text" x="%d" y="%d" style="font-size: %dpx;">%s</text>`,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 803 KiB After Width: | Height: | Size: 803 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 650 KiB After Width: | Height: | Size: 650 KiB |
|
|
@ -842,7 +842,7 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske
|
||||||
}
|
}
|
||||||
|
|
||||||
if targetShape.Tooltip != "" {
|
if targetShape.Tooltip != "" {
|
||||||
fmt.Fprintf(writer, `<g transform="translate(%d %d)">%s</g>`,
|
fmt.Fprintf(writer, `<g transform="translate(%d %d)" class="tooltip-icon">%s</g>`,
|
||||||
targetShape.Pos.X+targetShape.Width-tooltipIconRadius,
|
targetShape.Pos.X+targetShape.Width-tooltipIconRadius,
|
||||||
targetShape.Pos.Y-tooltipIconRadius,
|
targetShape.Pos.Y-tooltipIconRadius,
|
||||||
TooltipIcon,
|
TooltipIcon,
|
||||||
|
|
@ -959,7 +959,7 @@ func embedFonts(buf *bytes.Buffer, fontFamily *d2fonts.FontFamily) {
|
||||||
if strings.Contains(content, t) {
|
if strings.Contains(content, t) {
|
||||||
buf.WriteString(`
|
buf.WriteString(`
|
||||||
.tooltip-icon {
|
.tooltip-icon {
|
||||||
box-shadow: 0px 0px 32px rgba(31, 36, 58, 0.1);
|
filter: drop-shadow(0px 0px 32px rgba(31, 36, 58, 0.1));
|
||||||
}`)
|
}`)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue