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

Block layout nitpicks #52

Open
hildjj opened this issue Apr 16, 2023 · 2 comments
Open

Block layout nitpicks #52

hildjj opened this issue Apr 16, 2023 · 2 comments

Comments

@hildjj
Copy link
Owner

hildjj commented Apr 16, 2023

This input:

block Do a thing
  A->B: Some messages
end

loop Many times
  A->B: Some messages
end

opt Might happen
  A->B: Some messages
end

yields this output:

block

Nits:

  • the block text should be moved horizontally so it starts to the right of the A line.
  • the opt and loop tabs are a little too short. Those should be driven by the font size, plus a margin
  • the baselines for the text "opt" and the text "Might happen" should either be aligned, or be a little more different, so that it doesn't just look like sloppiness. Same for loop.

@ekr would you mind taking a look at these since you were just in there?

@ekr
Copy link
Contributor

ekr commented Apr 16, 2023

Yeah, I can take a look. We can, as you suggest estimate based on the font size, but it seems like it would be better if draw_label() actually returned the width. It seems like at least PDFDriver.js knows this information, but I'm not sure if it's in the right units.

@hildjj
Copy link
Owner Author

hildjj commented Apr 17, 2023

Calculating font metrics correctly outside the browser for SVG is going to be a PITA, since I don't want to take a dependency on canvas or similar. It's fine to just put a quick heuristic in.

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

2 participants