Lemmings Forums

NeoLemmix => NeoLemmix Main => Archived Bugs & Suggestions => Topic started by: Nepster on February 05, 2016, 11:00:21 PM

Title: [SUGGESTION] [EDITOR] [ADDED] Zoom into the Center
Post by: Nepster on February 05, 2016, 11:00:21 PM
Status: Implemented for next update.
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: Nepster on February 05, 2016, 11:01:00 PM
Unless some terrain piece/object is selected, the visible area jumps wildy when zooming in or out. To me the current algorithm is very mysterious - I wouldn't even be surprised if the new position is completely random ;P.
It would be much more natural to zoom into the center of the currently visible area instead.
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: namida on February 06, 2016, 12:09:04 AM
It would appear it zooms in on wherever the mouse cursor is. I'll look into whether this can be changed to your suggestion.

EDIT: I'm not really noticing any way within the current setup how I can find what would be the current on-screen position, so I don't think I'll be able to implement this change. I'll keep it open in case I think of something in the future.
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: Nepster on February 06, 2016, 03:11:16 PM
Two ideas:
1) If you add a terrain piece, this is added where you clicked on the screen. So the terrain addition algorithm should contain some code to determine the current screen position.
2) The position of the scroll bars should be kept somewhere and from this the screen position should be computable. Hopefully some code for this is already written where the scroll bar functions are encoded.
Of course there is still the problem to recognize these code parts...
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: namida on February 07, 2016, 03:32:08 AM
I already considered the scroll bars, and while I could get some details from them, I couldn't spot any obvious way to deduce the position. When I tried, it always seemed to just zoom into the furthest-right part of the level (unless a terrain piece was selected).

I believe the terrain piece placing - just like many other stuff - first converts the current mouse position (in absolute terms) to the position on the bitmap image (similar to in a paint program, how if you hover your mouse over a pixel then look at the mouse position shown near the bottom, it doesn't show the absolute position, but rather the pixel coordinates within the image). This is also how zoom currently works when nothing's selected - it zooms in on the mouse position. This wouldn't offer any existing benefit, as far as I can tell.
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: mobius on February 16, 2016, 01:58:50 AM
I think it's just fine the way it is= being able to zoom in anywhere; where you have the cursor is really nice. Actually I might prefer it if it's always this way, verses always centering in on the piece currently selected.
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: namida on February 16, 2016, 02:09:00 AM
Hm... it might be nice, but it's also very non-standard...

Anyway, I think I may have found a way to do this at last. :) Still working out the exact calculation, but I found some properties that may actually be useful for implementing this.
Title: Re: [SUGGESTION] [EDITOR] Zoom into the Center
Post by: namida on February 16, 2016, 03:21:53 AM
FINALLY! I managed to do this. :)

I'll have it in for the next update. But it looks like this is another thing that should be user-configurable.

EDIT: I've put 4 options:

1. Zoom on selection if any; or otherwise on center of current view (new default)
2. Zoom on selection if any; or otherwise on mouse position (current behaviour)
3. Zoom on center of current view
4. Zoom on mouse position