From: TangoCash Date: Sat, 4 Jun 2016 19:46:06 +0000 (+0200) Subject: supplemental to last commit X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=2d26806809adb30200c68d0fe3941d968ad983e3;p=lcd4linux.git supplemental to last commit --- diff --git a/widget_image.c b/widget_image.c index 2f374f7..a08bf85 100644 --- a/widget_image.c +++ b/widget_image.c @@ -194,9 +194,13 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image) int cx = (DCOLS/2) - (ox/2); int cy = (oy < Image->oldheight) ? Image->oldheight : oy; center_image = gdImageCreateTrueColor(DCOLS,cy); + if (cy > oy) + cy = (cy / 2) - (oy / 2); + else + cy = 0; gdImageSaveAlpha(center_image, 1); gdImageFill(center_image, 0, 0, gdImageColorAllocateAlpha(center_image, 0, 0, 0, 127)); - gdImageCopyResized(center_image,Image->gdImage,cx,0,0,0,ox,oy,ox,oy); + gdImageCopyResized(center_image,Image->gdImage,cx,cy,0,0,ox,oy,ox,oy); gdImageDestroy(Image->gdImage); Image->gdImage = center_image; }