Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Signal Name Width Computation for tspan Entries #398

Open
Ganesh-AT opened this issue Oct 30, 2023 · 0 comments
Open

Incorrect Signal Name Width Computation for tspan Entries #398

Ganesh-AT opened this issue Oct 30, 2023 · 0 comments

Comments

@Ganesh-AT
Copy link

Please describe your system environment before submitting your Issue.

WaveDrom v3.3.0 incorrectly computes the signal name width if the name is a tspan object instead of a string. Example:

image

The issue is due to Line 75 in render-wave-lane.js

glengths.push(name.textWidth ? name.textWidth : name.charCodeAt ? textWidth(name, 11) : 0);

The above returns a sane value only if name is a string. It would be great if tspan objects are also supported.

The current workaround that I am using to avoid the bug exposed in the above screenshot is to ensure that at least one non-tspan signal lane name is longer than the tspan ones. But, this might not always be possible (particularly if some diagram requires all signal names to be rendered differently using tspan support).

@Ganesh-AT Ganesh-AT changed the title Incorrect Signal Name Computation for tspan Entries Incorrect Signal Name Width Computation for tspan Entries Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant