Revision: 2428
http://sourceforge.net/p/swingme/code/2428
Author: yuranet
Date: 2021-03-19 11:44:06 +0000 (Fri, 19 Mar 2021)
Log Message:
-----------
more rounding errors handled
Modified Paths:
--------------
AndroidME/src_MIDP/javax/microedition/lcdui/Image.java
Modified: AndroidME/src_MIDP/javax/microedition/lcdui/Image.java
===================================================================
--- AndroidME/src_MIDP/javax/microedition/lcdui/Image.java 2021-03-19 06:54:29 UTC (rev 2427)
+++ AndroidME/src_MIDP/javax/microedition/lcdui/Image.java 2021-03-19 11:44:06 UTC (rev 2428)
@@ -336,11 +336,27 @@
if (height == 0) {
height = 1;
}
+ if (width == 0) {
+ width = 1;
+ }
// can end up 1 more then end through rounding error
if (y + height == bitmap.getHeight() + 1) {
- y = bitmap.getHeight() - height;
+ if (y == 0) {
+ height = bitmap.getHeight();
+ }
+ else {
+ y = bitmap.getHeight() - height;
+ }
}
+ if (x + width == bitmap.getWidth() + 1) {
+ if (x == 0) {
+ width = bitmap.getWidth();
+ }
+ else {
+ x = bitmap.getWidth() - width;
+ }
+ }
if (scanlength < width) {
int[] data = new int[width * height];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|