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

Feature: Add vertical offset to adjacent hints #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

markstos
Copy link

@markstos markstos commented Feb 24, 2022

This addresses #145 by adding some vertical offset when labels are next to each other,
clarifying that a child's label is not part of the parent's label.

I don't like that the offset is a fixed number here. I wanted it to be a percentage of the letter's
height. I tried this:

y = y+(i32::from(height) / 2) as i16;

But that was only right for a single overlap. For multiple-overlaps, the offset for the third
letter was doubled, so it was 100% lower than the one to the left instead of 50% lower.

This patch is also compatible with the most recent Sway branch, PR #138.

Screenshots

Before

image

After

swappy-20220225_093509

@markstos markstos changed the title Feature: Increase y offset when there's overlap. Feature: Add vertical offset to adjacent hints Feb 25, 2022
@svenstaro
Copy link
Owner

Hey, sorry for not looking at this for all this time. I'm looking at this now!

@markstos
Copy link
Author

markstos commented Feb 2, 2023

Thanks.

@svenstaro
Copy link
Owner

Oh, I never submitted my review:

I like the idea but I wonder what the best way to go about this is. As it is, we already do have separation between the labels and at least in my configuration, they are quite distinct. Would you prefer a configurable vertical and horizontal multiplier perimeter? Perhaps slightly changing/alternating the tint or brightness of the labels would also be a good idea? What do you think?

@markstos
Copy link
Author

markstos commented Feb 2, 2023

In my patch, there's a fixed vertical offset. What I'd like ideally is a vertical offset is that gets small the deeper the nesting is. So perhaps the first offset is 40% of the height, the next 20%, the next 10%. There's rarely more nesting than that.

The problem with a consistent offset, say like 50%, is after two offsets one block is 100% below the other and looks bad. But if the initial offset is too small, like 10%, then it might look like bad alignment and not intentional.

I don't think a configurable horizontal offset is also necessary. Regarding colors, currently there's already colors for "focused" and "not focused", and I think adding more means of colors could confuse that. I've been using the simple vertical offset patch for about a year and it's been clear enough.

I didn't figure out how to make the offsets smaller with deeper nesting, though.

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.

None yet

2 participants