Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Logo is in the middle of free space now. *) Fixed bugs in insertBitmap()

low012ee8a177c260a
diff --git a/source/de/anomic/plasma/plasmaGrafics.java b/source/de/anomic/plasma/plasmaGrafics.java
index 2c25f8a63..9add8dbb1 100644
--- a/source/de/anomic/plasma/plasmaGrafics.java
+++ b/source/de/anomic/plasma/plasmaGrafics.java
@@ -403,7 +403,9 @@ public class plasmaGrafics {
ymageToolPrint.print(bannerPicture, 285, 52, 0, "SPEED: " + addTrailingBlanks(nppm + " PAGES/MINUTE", exprlength), -1);
if (logo != null) {
- bannerPicture.insertBitmap(logo, 2, 2);
+ int x = (int)(100/2 - logo.getWidth()/2);
+ int y = (int)(height/2 - logo.getHeight()/2);
+ bannerPicture.insertBitmap(logo, x, y);
}
if (!bordercolor.equals("")) {
@@ -425,13 +427,6 @@ public class plasmaGrafics {
return true;
}
- //[MN]
- /* quoted method because it is not used anywhere (and creates a warning in eclipse)
- private static String addBlanksAndDots(int input, int length) {
- return addBlanksAndDots(input + "", length);
- }
- */
-
//[MN]
private static String addBlanksAndDots(long input, int length) {
return addBlanksAndDots(input + "", length);
diff --git a/source/de/anomic/ymage/ymageMatrix.java b/source/de/anomic/ymage/ymageMatrix.java
index bf003bbbc..1cf697335 100644
--- a/source/de/anomic/ymage/ymageMatrix.java
+++ b/source/de/anomic/ymage/ymageMatrix.java
@@ -279,9 +279,12 @@ public class ymageMatrix /*implements Cloneable*/ {
int heightTgt = image.getHeight();
int widthTgt = image.getWidth();
- for (int i = y; i < heightSrc && i < heightTgt - y; i++) {
- for (int j = x; j < widthSrc && j < widthTgt - x; j++) {
- image.setRGB(j, i, bitmap.getRGB(j, i));
+ for (int i = 0; i < heightSrc; i++) {
+ for (int j = 0; j < widthSrc; j++) {
+ // pixel in legal area?
+ if (j+x >= 0 && i+y >= 0 && i+y < heightTgt && j+x < widthTgt) {
+ image.setRGB(j+x, i+y, bitmap.getRGB(j, i));
+ }
}
}
}