Browse Source

neercs: clamp canvas size to ensure we never get to zero.

master
Sam Hocevar 12 years ago
parent
commit
12d769809e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      neercs/video/render.cpp

+ 2
- 1
neercs/video/render.cpp View File

@@ -368,6 +368,7 @@ void Render::UpdateSize()
screen_size = Video::GetSize();
//border.y = border.x; // enabled to get same border everywhere
canvas_char = (screen_size - border * 2) / (font_size * ratio_2d);
canvas_char = max(canvas_char, ivec2(1, 1));
canvas_size = canvas_char * font_size * ratio_2d;

border = (screen_size - canvas_size) / 2;
@@ -1126,4 +1127,4 @@ void Render::Draw3D()

Render::~Render()
{
}
}

Loading…
Cancel
Save