4257: Allow zooming any distance in editor r=edg-l a=def-

as requested by Knuski

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2021-10-28 09:20:40 +00:00 committed by GitHub
commit de861881fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5939,13 +5939,14 @@ void CEditor::Render()
if(Zoom != 0)
{
float OldLevel = m_ZoomLevel;
m_ZoomLevel = clamp(m_ZoomLevel + Zoom * 20, 10, 2000);
m_ZoomLevel = maximum(m_ZoomLevel + Zoom * 20, 10);
if(g_Config.m_ClLimitMaxZoomLevel)
m_ZoomLevel = minimum(m_ZoomLevel, 2000);
if(g_Config.m_EdZoomTarget)
ZoomMouseTarget((float)m_ZoomLevel / OldLevel);
}
}
m_ZoomLevel = clamp(m_ZoomLevel, 10, 2000);
m_WorldZoom = m_ZoomLevel / 100.0f;
if(m_GuiActive)