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

Remove extra vertical space for any label with no message set #82

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

Override-6
Copy link
Contributor

@Override-6 Override-6 commented Jun 9, 2023

Hello @zesterer !
There is an issue where the library stills draw extra spaces for labels with no messages, the library still allocate a line regardless if the label has an arrow to display.

This was reported by @kaikalii in #51, adding a check here seems to fix the issue.

ariadne/src/write.rs

Lines 606 to 609 in 8225799

//No message to draw thus no arrow to draw
if line_label.label.msg.is_none() {
continue
}

however there's still some issues with multiline labels, i need you to determine how this can be handled :

image

Also, i could'nt find an efficient way to write tests for this PR, thus i allowed myself to add a new example to prove the fix.
image

other examples
image

@zesterer
Copy link
Owner

Thanks so much! Regarding multi-line labels, I've pushed up a commit that should address this. Hopefully with a rebase, this should all work. Let me know when you're ready to merge.

@Override-6
Copy link
Contributor Author

rebase done

@zesterer zesterer merged commit 1356421 into zesterer:main Jun 14, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

Labels without messages still create extra vertical space
2 participants