mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #4257
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:
commit
de861881fb
|
@ -5939,13 +5939,14 @@ void CEditor::Render()
|
||||||
if(Zoom != 0)
|
if(Zoom != 0)
|
||||||
{
|
{
|
||||||
float OldLevel = m_ZoomLevel;
|
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)
|
if(g_Config.m_EdZoomTarget)
|
||||||
ZoomMouseTarget((float)m_ZoomLevel / OldLevel);
|
ZoomMouseTarget((float)m_ZoomLevel / OldLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ZoomLevel = clamp(m_ZoomLevel, 10, 2000);
|
|
||||||
m_WorldZoom = m_ZoomLevel / 100.0f;
|
m_WorldZoom = m_ZoomLevel / 100.0f;
|
||||||
|
|
||||||
if(m_GuiActive)
|
if(m_GuiActive)
|
||||||
|
|
Loading…
Reference in a new issue