wentam / mapsforge

Fork of mapsforge with hacks to make it work well for low-resolution black&white displays
GNU Lesser General Public License v3.0
0 stars 0 forks source link

The way display="ifspace" works alongside PathText is a poor mechanism for cramming text into a small display #1

Open wentam opened 5 years ago

wentam commented 5 years ago

Current system goes something like this: Render out the text with gaps along the entire way, then remove any that clash afterwords

This is a big problem on small screens, as there are many situations in which a street name could fit if the correct spot was attempted. The current system just blindy attempts spaces based on the repeat rules, and on a small screen it often won't line up with the blank space available.

My theory to get good behavior: Exclude pathtext from the normal collision checking and make it work out collisions on it's own:

  1. When attempting to render a string of text and it collides with something, calculate exactly how far we need to move in order to not be colliding with that thing
  2. Attempt the new spot+repeatStart (or some other padding variable) to offer some padding.
  3. If we are now colliding with a new object, go to step 1. with the new object
  4. If we have a successful location, offset by repeatGap and try the next object

pathtext's "special" collision checking still needs to honor display="always" and display="never" if they are set.

wentam commented 5 years ago

Actually, excluding pathtext from normal collision checking isn't really needed.

I don't think it costs much cpu time, and if WayDecorator does it's job correctly it won't undo any of it's work.