mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-04 14:37:46 -04:00
center loaded background image in larger screen
This commit is contained in:
parent
a8b4c53d77
commit
3ccc039bba
1 changed files with 4 additions and 2 deletions
|
@ -80,12 +80,14 @@ int readpng(void *dest, const char *fname, readpng_what what, int req_w, int req
|
|||
if (width > req_w) {
|
||||
x_ofs = (width - req_w) / 2;
|
||||
width = req_w;
|
||||
}
|
||||
} else
|
||||
dst += (req_w - width) / 2;
|
||||
height = png_get_image_height(png_ptr, info_ptr);
|
||||
if (height > req_h) {
|
||||
y_ofs = (height - req_h) / 2;
|
||||
height = req_h;
|
||||
}
|
||||
} else
|
||||
dst += (req_h - height) / 2 * req_w;
|
||||
|
||||
for (h = 0; h < height; h++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue