Menu

#118 Scrollable Map

open
nobody
None
5
2012-03-04
2012-03-04
ManDay
No

It would be great if large maps would not be scaled down to un-readability if the window is too small (say, laptop) but instead the map would be scrollable.

Discussion

  • Bas Wijnen

    Bas Wijnen - 2012-03-04

    Indeed. I think this should be done by implementing a "zoom level" setting (probably a GtkScale), plus a checkbox to select "fit screen". If that checkbox is set, the behaviour is like it is now. If not, the map should be the selected size, and inside a GtkScrolledWindow.

    I think I don't have time to implement this any time soon, though. Patches very welcome. :-)

     
  • ManDay

    ManDay - 2012-03-04

    How do you suggest the GtkScale is interpreted? I.e.: Which zoom corresponds to "Slider all the way left" and "all the way right", respectively?

     
  • Bas Wijnen

    Bas Wijnen - 2012-03-04

    That's a bit of a problem. Best would be to have a widget which allows infinite scaling up, but that doesn't exist. However, in this case it isn't really required anyway, I think.

    All the way left should be 0 and mean the smallest. All the way right should be the largest usable setting. It could be 100 (so it's a percentage) and mean "allocation width pixels per hex". In fact, if the setting is relative to the screen size, the "fit screen" checkbox can be omitted. The initial value should be set during game load, based on the board size. This initial value would preferably be overridable from the commandline and/or the configuration file.

    It might also be good to make it a spitbutton instead of a scale. Or perhaps both, so it can be moved, but also numerical input is possible.

     
  • ManDay

    ManDay - 2012-03-04

    I might be fantasizing now, as this is probably more thought about implementation than eventually worth, but what about a slider which "snaps back" to the center after you dragged it to left-right?

    Example: Start of as a centered slider, dragging the slider to either direction changes the zoom level according to

    zoom = zoom * (-1) * min( G,ln( 1-abs( x ) ) )*pow( x,3 ) * K

    where x ranges from -1 to 1 on the slider and K is some (small) factor to allow sensible zoom. And then the slider snaps back. (If you plot that function you see that it has vertical assymptodes at -1 and 1, so that if you drag the slider to either side, you would get infinite zoom out/in - which would be prevented by some reasonable limit G)

     
  • Bas Wijnen

    Bas Wijnen - 2012-03-04

    Such a widget would nicely solve the limit-problem. However, in this case I think we don't really have the problem, so it would be overkill (and a needlessly complex gui) to use it. After all, there is a real minimum (0) and a reasonable maximum (one tile filling the entire screen).

     
  • Roland Clobus

    Roland Clobus - 2012-03-04

    Zooming the map already entered Pioneers on 2011-02-23 using a patch from Micah Bunting. This was released as version 0.12.5

    All you have to do it so use your scroll wheel when the mouse pointer is over the map. You can zoom in and out as far as you want to. When you press the button of the scroll wheel (the second mouse button) you can drag/pan the map.
    View|Reset resets to the default, View|Center moves to the center of the map.

     
  • Bas Wijnen

    Bas Wijnen - 2012-03-04

    That shows how much attention I'm paying! Sorry about that, and thanks for the reminder. :-)

     
  • ManDay

    ManDay - 2012-03-04

    Eh :) Great. The panning thing is a little jumpy, though. It does not pan very fluently.

    I'm not a big fan of exclusive MMB for essential operations, by the way (meaning the only way to access a function is using MMB), could you perhaps change this to RMB - if I'm not mistaken RMB currently has no other use.

     
  • Roland Clobus

    Roland Clobus - 2012-03-04

    The RMB is in use in the editor which also has the zoom & pan capability.

    The panning is jumpy, because it receives a lot of redraws, each of which redraw the whole map (which takes time) instead of refreshing only the active viewport. It works well enough for me, because I'm running FullHD...

     
  • ManDay

    ManDay - 2012-03-04

    As for MMB, I can only say I'm not able to pan on my laptop or tablet then, if you understand my problem.

     

Log in to post a comment.