Integer color = new Integer(argb | 0xFF000000);
Picture pg = (Picture)pictures.get(color);
if (pg == null) {
+ int[] data2 = new int[data.length];
for(int i=0; i<data.length; i++)
- data[i] = (data[i] & 0xFF000000) | (argb & 0x00FFFFFF);
- pg = Platform.createPicture(data, w, h);
+ data2[i] = (data[i] & 0xFF000000) | (argb & 0x00FFFFFF);
+ pg = Platform.createPicture(data2, w, h);
pictures.put(color, pg);
}
int left = x;
for(int i=0; i<text.length(); i++) {
int c = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".indexOf(text.charAt(i));
- if (c == -1 || metrics[c] == null) { left += metrics[64][4]; continue; }
+ if (c == -1 || metrics[c] == null) {
+ left += metrics[64] != null ? metrics[64][4] : 10;
+ continue;
+ }
buf.drawPicture(pg,
left,
y - (metrics[c][5] - metrics[c][2]),