summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c20
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c20
2 files changed, 32 insertions, 8 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
index 5ebc3bd573..eb14152775 100644
--- a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
@@ -127,15 +127,27 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
127 127
128 if (x + width > current_vp->width) 128 if (x + width > current_vp->width)
129 width = current_vp->width - x; /* Clip right */ 129 width = current_vp->width - x; /* Clip right */
130 if (x < 0) 130
131 width += x, x = 0; /* Clip left */ 131 if (x < 0) /* Clip left */
132 {
133 width += x;
134 src_x -= x;
135 x = 0;
136 }
137
132 if (width <= 0) 138 if (width <= 0)
133 return; /* nothing left to do */ 139 return; /* nothing left to do */
134 140
135 if (y + height > current_vp->height) 141 if (y + height > current_vp->height)
136 height = current_vp->height - y; /* Clip bottom */ 142 height = current_vp->height - y; /* Clip bottom */
137 if (y < 0) 143
138 height += y, y = 0; /* Clip top */ 144 if (y < 0) /* Clip top */
145 {
146 height += y;
147 src_y -= y;
148 y = 0;
149 }
150
139 if (height <= 0) 151 if (height <= 0)
140 return; /* nothing left to do */ 152 return; /* nothing left to do */
141 153
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c
index f3461cfe91..62880790d1 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c
@@ -421,15 +421,27 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
421 421
422 if (x + width > current_vp->width) 422 if (x + width > current_vp->width)
423 width = current_vp->width - x; /* Clip right */ 423 width = current_vp->width - x; /* Clip right */
424 if (x < 0) 424
425 width += x, x = 0; /* Clip left */ 425 if (x < 0) /* Clip left */
426 {
427 width += x;
428 src_x -= x;
429 x = 0;
430 }
431
426 if (width <= 0) 432 if (width <= 0)
427 return; /* nothing left to do */ 433 return; /* nothing left to do */
428 434
429 if (y + height > current_vp->height) 435 if (y + height > current_vp->height)
430 height = current_vp->height - y; /* Clip bottom */ 436 height = current_vp->height - y; /* Clip bottom */
431 if (y < 0) 437
432 height += y, y = 0; /* Clip top */ 438 if (y < 0) /* Clip top */
439 {
440 height += y;
441 src_y -= y;
442 y = 0;
443 }
444
433 if (height <= 0) 445 if (height <= 0)
434 return; /* nothing left to do */ 446 return; /* nothing left to do */
435 447