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

Improved the position of the directory labels. #181

Open
wants to merge 3 commits into
base: symmetric-dir-names
Choose a base branch
from

Conversation

SmallLars
Copy link

  • Vertical and horizontal alignment always need to match
    to avoid overlapping of the label and the line.
  • Inverting the alignment on dir_name_position > 0.5 is only
    meaningful on a flat angle (below 45 degree in relation to
    the x axis) to avoid moving names on top of each other.

@acaudwell
Copy link
Owner

I think it looks pretty good. Maybe it should offset slightly more so that most of the time it wont still be touching the edge? OTH it makes it easier to tell what edge it belongs to. I wonder if there are cases where that is harder to discern now.

The == 0 comparisons should be == 0.0f since its a float. It probably doesnt matter too much but in general if you compare floats with integers strange things will happen.

* Vertical and horizontal alignment always need to match
  to avoid overlapping of the label and the line.
* Inverting the alignment on dir_name_position > 0.5 is only
  meaningful on a flat angle (below 45 degree in relation to
  the x axis) to avoid moving names on top of each other.
@SmallLars
Copy link
Author

hmm.... change the offset would mean to use something like

left align: vec2 new_offset(-2.0f, -2.0f);
right align: label_size - new_offset;

to consider both alignments. But for me it is ok, when the label is touching the edge.

@SmallLars
Copy link
Author

I splitted it into two commits, to introduce the offset seperate,

@SmallLars
Copy link
Author

Any idea when you have time for this?

@acaudwell
Copy link
Owner

This is looking pretty good. Sorry I'm pretty busy at the moment.

@acaudwell
Copy link
Owner

The repositioning animation is really pleasant now. The actual position of the labels though often isn't better than just putting them in the middle of the line segment in a lot of cases. When a directory has a lot of files the label overlaps the file wheel.

The reference I'm mostly trying this with is the Linux kernel, mainly focusing on how the outer satellite directories look, whether its clear what directory the label corresponds to.

Maybe the label should be positioned between the 'file wheel' of the current directory and the parent directory.

Also the hard coded offset distance maybe needs to be scaled to the length of the branch (in screen space - ie pixels), as it looks too far away when zoomed out.

@SmallLars
Copy link
Author

I am at the end of my wisdom. Default is centering the labels on dir_name_position = 0.5 now.

When dir_name_position is changed, the alignment of the labels will change keeping the symmetry and avoid overlapping of the labels and edges.

I also changed the hard coded offset to 25% of the text height. Using the length of the branch looks not like a good idea, because the distance becomes big sometimes while the text size is the same. So the label no longer looks connected to the branch. Decreasing the distance results in something like "no offset" on short branches.

@SmallLars
Copy link
Author

Can you give me some feedback what to do? Would be great when we can finish this feature. It is ok for me to keep the j-Key to enable this feature. I can also add a command line option if you would like.

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.

2 participants