clamp screen sizes to 1 to avoid impossible division-by-zero for window shots

CID 1040148
This commit is contained in:
Mike Blumenkrantz 2014-03-13 12:50:18 -04:00
parent e0a5cd6e7d
commit 457a385fa7
1 changed files with 2 additions and 2 deletions

View File

@ -647,8 +647,8 @@ _shot_now(E_Zone *zone, E_Client *ec, const char *params)
h = sh;
x = E_CLAMP(x, ec->zone->x, ec->zone->x + ec->zone->w);
y = E_CLAMP(y, ec->zone->y, ec->zone->y + ec->zone->h);
sw = E_CLAMP(sw, 0, ec->zone->x + ec->zone->w - x);
sh = E_CLAMP(sh, 0, ec->zone->y + ec->zone->h - y);
sw = E_CLAMP(sw, 1, ec->zone->x + ec->zone->w - x);
sh = E_CLAMP(sh, 1, ec->zone->y + ec->zone->h - y);
visual = e_pixmap_visual_get(ec->pixmap);
depth = ec->depth;
}