acaudwell / Gource

software version control visualization
https://gource.io
GNU General Public License v3.0
11.55k stars 723 forks source link

Improved the position of the directory labels. #181

Open SmallLars opened 6 years ago

SmallLars commented 6 years ago
acaudwell commented 6 years ago

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.

SmallLars commented 6 years ago

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 commented 5 years ago

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

SmallLars commented 5 years ago

Any idea when you have time for this?

acaudwell commented 5 years ago

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

acaudwell commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.