wader / ansisvg

Convert ANSI to SVG
MIT License
89 stars 9 forks source link

Prettier svg code #41

Closed patrislav1 closed 8 months ago

patrislav1 commented 8 months ago

This PR attempts to produce less verbose / more concise SVG code. The rendered graphics should stay the same.

BTW, I tried to make the background rects inherit height and y attributes from a parent <g> element, to reduce repetition, but apparently <g> can only impose a style to child elements, not coordinates or dimensions.

wader commented 8 months ago

Looks great! tried it out with chrome on macOS and can't see any issues.

But i did notice a thing unrelated to this change (happens without this change also) that powerline.svg is rendered with wrong character dimensions until the windows is reiszed etc then it snaps to correct size... feels like browser bug?

wader commented 8 months ago

BTW, I tried to make the background rects inherit height and y attributes from a parent element, to reduce repetition, but apparently can only impose a style to child elements, not coordinates or dimensions.

Good to know!

wader commented 8 months ago

First

Screenshot 2024-01-26 at 17 14 46

After resize

Screenshot 2024-01-26 at 17 14 55

Weird and not sure i noticed it before. Anyway, not related to this PR

patrislav1 commented 8 months ago

First Screenshot 2024-01-26 at 17 14 46

After resize Screenshot 2024-01-26 at 17 14 55

Weird and not sure i noticed it before. Anyway, not related to this PR

I also see it in both Chrome and Firefox; can't imagine this a browser bug in completely different browser engines :thinking:

wader commented 8 months ago

I also see it in both Chrome and Firefox; can't imagine this a browser bug in completely different browser engines 🤔

Huh yes that seems unlikely