fixed size of characters in editor's tileselection screen on zoom. Closes #665

This commit is contained in:
oy 2011-05-05 01:50:23 +02:00
parent 5fbf6d0bfd
commit ca6e129da6
3 changed files with 11 additions and 10 deletions

View file

@ -1154,10 +1154,10 @@ void CEditor::DoQuadPoint(CQuad *pQuad, int QuadIndex, int V)
Graphics()->QuadsDraw(&QuadItem, 1);
}
void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar, bool ShowPicker)
void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
{
// render all good stuff
if(!ShowPicker)
if(!m_ShowPicker)
{
for(int g = 0; g < m_Map.m_lGroups.size(); g++)
{
@ -1201,7 +1201,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar, bool ShowPicker)
};
// remap the screen so it can display the whole tileset
if(ShowPicker)
if(m_ShowPicker)
{
CUIRect Screen = *UI()->Screen();
float Size = 32.0*16.0f;
@ -1230,7 +1230,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar, bool ShowPicker)
int NumEditLayers = 0;
NumEditLayers = 0;
if(ShowPicker)
if(m_ShowPicker)
{
pEditLayers[0] = &m_TilesetPicker;
NumEditLayers++;
@ -1434,7 +1434,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar, bool ShowPicker)
// quad editing
{
if(!ShowPicker && m_Brush.IsEmpty())
if(!m_ShowPicker && m_Brush.IsEmpty())
{
// fetch layers
CLayerGroup *g = GetSelectedGroup();
@ -3029,7 +3029,7 @@ void CEditor::Render()
RenderBackground(View, ms_CheckerTexture, 32.0f, 1.0f);
CUIRect MenuBar, CModeBar, ToolBar, StatusBar, EnvelopeEditor, ToolBox;
bool ShowPicker = Input()->KeyPressed(KEY_SPACE) != 0 && m_Dialog == DIALOG_NONE;
m_ShowPicker = Input()->KeyPressed(KEY_SPACE) != 0 && m_Dialog == DIALOG_NONE;
if(m_GuiActive)
{
@ -3039,7 +3039,7 @@ void CEditor::Render()
View.VSplitLeft(100.0f, &ToolBox, &View);
View.HSplitBottom(16.0f, &View, &StatusBar);
if(m_ShowEnvelopeEditor && !ShowPicker)
if(m_ShowEnvelopeEditor && !m_ShowPicker)
{
float size = 125.0f;
if(m_ShowEnvelopeEditor == 2)
@ -3052,7 +3052,7 @@ void CEditor::Render()
// a little hack for now
if(m_Mode == MODE_LAYERS)
DoMapEditor(View, ToolBar, ShowPicker);
DoMapEditor(View, ToolBar);
if(m_GuiActive)
{

View file

@ -630,6 +630,7 @@ public:
float m_AnimateSpeed;
int m_ShowEnvelopeEditor;
bool m_ShowPicker;
int m_SelectedLayer;
int m_SelectedGroup;
@ -697,7 +698,7 @@ public:
vec4 ButtonColorMul(const void *pID);
void DoQuadPoint(CQuad *pQuad, int QuadIndex, int v);
void DoMapEditor(CUIRect View, CUIRect Toolbar, bool ShowPicker);
void DoMapEditor(CUIRect View, CUIRect Toolbar);
void DoToolbar(CUIRect Toolbar);
void DoQuad(CQuad *pQuad, int Index);
float UiDoScrollbarV(const void *pID, const CUIRect *pRect, float Current);

View file

@ -123,7 +123,7 @@ void CLayerTiles::BrushSelecting(CUIRect Rect)
m_pEditor->Graphics()->QuadsEnd();
char aBuf[16];
str_format(aBuf, sizeof(aBuf), "%d,%d", ConvertX(Rect.w), ConvertY(Rect.h));
TextRender()->Text(0, Rect.x+3.0f, Rect.y+3.0f, 15.0f*m_pEditor->m_WorldZoom, aBuf, -1);
TextRender()->Text(0, Rect.x+3.0f, Rect.y+3.0f, m_pEditor->m_ShowPicker?15.0f:15.0f*m_pEditor->m_WorldZoom, aBuf, -1);
}
int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)