Skip to content

Commit cd716e0

Browse files
committed
feat!: Adjust placement for hold/shifted + two-line tap
1 parent afd87c7 commit cd716e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

keymap_drawer/draw/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ def _draw_text(self, p: Point, word: str, classes: Sequence[str]) -> None:
128128
def _draw_textblock(self, p: Point, words: Sequence[str], classes: Sequence[str], shift: float = 0) -> None:
129129
words = [self._truncate_word(word) for word in words]
130130
self.out.write(f'<text x="{round(p.x)}" y="{round(p.y)}"{self._to_class_str(classes)}>\n')
131-
dy_0 = (len(words) - 1) * (self.cfg.line_spacing * (1 + shift) / 2)
131+
dy_0 = (len(words) - 1) * (self.cfg.line_spacing * (1 + shift / 2) / 2)
132132
scaling = self._get_scaling(max(len(w) for w in words))
133-
self.out.write(f'<tspan x="{round(p.x)}" dy="-{dy_0}em"{scaling}>{escape(words[0])}</tspan>')
133+
self.out.write(f'<tspan x="{round(p.x)}" dy="-{round(dy_0, 2)}em"{scaling}>{escape(words[0])}</tspan>')
134134
for word in words[1:]:
135135
self.out.write(f'<tspan x="{round(p.x)}" dy="{self.cfg.line_spacing}em"{scaling}>{escape(word)}</tspan>')
136136
self.out.write("\n</text>\n")

0 commit comments

Comments
 (0)