Skip to content

Commit

Permalink
Merge pull request #1958 from midichef/graph_label_fullwidth
Browse files Browse the repository at this point in the history
[graph] fix legend display of full-width characters
  • Loading branch information
anjakefala committed Jul 12, 2023
2 parents 871af72 + 0ab5096 commit 2b74c63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions visidata/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _overlaps(a, b):
for o, fldraw in line:
if fldraw:
char_x, char_y, txt, attr, row = o
clipdraw(scr, char_y, char_x, txt, attr, len(txt))
clipdraw(scr, char_y, char_x, txt, attr, dispwidth(txt))


# - has a cursor, of arbitrary position and width/height (not restricted to current zoom)
Expand Down Expand Up @@ -359,7 +359,7 @@ def plotColor(self, k):
del self.legends[lastlegend]
legend = '[other]'

self.legendwidth = max(self.legendwidth, len(legend))
self.legendwidth = max(self.legendwidth, dispwidth(legend))
self.legends[legend] = attr
self.plotAttrs[k] = attr
self.plotlegends()
Expand Down

0 comments on commit 2b74c63

Please sign in to comment.