about summary refs log tree commit diff
path: root/src/game/editor/editor.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-08-06 13:08:29 +0200
committeroy <Tom_Adams@web.de>2011-08-06 13:08:29 +0200
commit003c0aa28132ade7b89ba5ed001bf819c8d0d381 (patch)
treef25b18be7d2f0c367fd42e3c1f3fc585cec1c911 /src/game/editor/editor.cpp
parentf1ea039df7b625c28073f46239b64854c480c1dc (diff)
downloadzcatch-003c0aa28132ade7b89ba5ed001bf819c8d0d381.tar.gz
zcatch-003c0aa28132ade7b89ba5ed001bf819c8d0d381.zip
fixed aspect ratio in the editor's image preview. Closes #784
Diffstat (limited to 'src/game/editor/editor.cpp')
-rw-r--r--src/game/editor/editor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp
index 40948d82..84308ab6 100644
--- a/src/game/editor/editor.cpp
+++ b/src/game/editor/editor.cpp
@@ -2417,6 +2417,9 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
 					r.w = r.h;
 				else
 					r.h = r.w;
+				float Max = (float)(max(m_Map.m_lImages[i]->m_Width, m_Map.m_lImages[i]->m_Height));
+				r.w *= m_Map.m_lImages[i]->m_Width/Max;
+				r.h *= m_Map.m_lImages[i]->m_Height/Max;
 				Graphics()->TextureSet(m_Map.m_lImages[i]->m_TexID);
 				Graphics()->BlendNormal();
 				Graphics()->QuadsBegin();