summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-12 02:15:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-12 02:15:04 +0000
commit77649a7a2cc84911d7945a32092b1ec1964c6e3d (patch)
tree7d72592c6869209772a0d6cc5ae0a80669076abe /firmware
parent53a76de82b4f1eeab294b6a829638c89a7daf543 (diff)
Fix FS#9782 - lcd_bitmap_transparent_part clipping but keep smaller clipping code. The bitmap coordinates were not being adjusted when clipping left and top. Also fix for Gigabeat S.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19752 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-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,
if (x + width > current_vp->width)
width = current_vp->width - x; /* Clip right */
- if (x < 0)
- width += x, x = 0; /* Clip left */
+
+ if (x < 0) /* Clip left */
+ {
+ width += x;
+ src_x -= x;
+ x = 0;
+ }
+
if (width <= 0)
return; /* nothing left to do */
if (y + height > current_vp->height)
height = current_vp->height - y; /* Clip bottom */
- if (y < 0)
- height += y, y = 0; /* Clip top */
+
+ if (y < 0) /* Clip top */
+ {
+ height += y;
+ src_y -= y;
+ y = 0;
+ }
+
if (height <= 0)
return; /* nothing left to do */
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,
if (x + width > current_vp->width)
width = current_vp->width - x; /* Clip right */
- if (x < 0)
- width += x, x = 0; /* Clip left */
+
+ if (x < 0) /* Clip left */
+ {
+ width += x;
+ src_x -= x;
+ x = 0;
+ }
+
if (width <= 0)
return; /* nothing left to do */
if (y + height > current_vp->height)
height = current_vp->height - y; /* Clip bottom */
- if (y < 0)
- height += y, y = 0; /* Clip top */
+
+ if (y < 0) /* Clip top */
+ {
+ height += y;
+ src_y -= y;
+ y = 0;
+ }
+
if (height <= 0)
return; /* nothing left to do */