diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-01-12 02:15:04 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-01-12 02:15:04 +0000 |
commit | 77649a7a2cc84911d7945a32092b1ec1964c6e3d (patch) | |
tree | 7d72592c6869209772a0d6cc5ae0a80669076abe | |
parent | 53a76de82b4f1eeab294b6a829638c89a7daf543 (diff) | |
download | rockbox-77649a7a2cc84911d7945a32092b1ec1964c6e3d.tar.gz rockbox-77649a7a2cc84911d7945a32092b1ec1964c6e3d.zip |
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
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c | 20 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | 20 |
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 | ||