Don't freak out on empty grids.
This commit is contained in:
parent
05b34b4818
commit
2b48b5da41
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,9 @@ namespace {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
int icon_at_coords (nana::point pos, int count, int columns, int w, int h, int spacing) {
|
int icon_at_coords (nana::point pos, int count, int columns, int w, int h, int spacing) {
|
||||||
|
if (not count)
|
||||||
|
return 0;
|
||||||
|
|
||||||
const int& x = pos.x;
|
const int& x = pos.x;
|
||||||
const int& y = pos.y;
|
const int& y = pos.y;
|
||||||
const int icon_rows = (count + (columns - 1)) / columns;
|
const int icon_rows = (count + (columns - 1)) / columns;
|
||||||
|
|
Loading…
Add table
Reference in a new issue