notaz.gp2x.de
/
libpicofe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8b4c53
)
center loaded background image in larger screen
author
kub
<derkub@gmail.com>
Mon, 8 Feb 2021 19:51:34 +0000
(20:51 +0100)
committer
kub
<derkub@gmail.com>
Wed, 26 Jan 2022 19:39:47 +0000
(19:39 +0000)
readpng.c
patch
|
blob
|
blame
|
history
diff --git
a/readpng.c
b/readpng.c
index
83936ae
..
ac24dd4
100644
(file)
--- a/
readpng.c
+++ b/
readpng.c
@@
-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++)
{