fix cookie and font renderer bugs
This commit is contained in:
@@ -21,7 +21,7 @@ window.GameSettings = class {
|
|||||||
|
|
||||||
save() {
|
save() {
|
||||||
for (let prop in this) {
|
for (let prop in this) {
|
||||||
document.cookie = prop + "=" + (this[prop] || "") + "; path=/";
|
document.cookie = prop + "=" + (this[prop] || "") + "; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ window.FontRenderer = class {
|
|||||||
let bitMap = this.createBitMap(this.texture);
|
let bitMap = this.createBitMap(this.texture);
|
||||||
|
|
||||||
// Calculate character width
|
// Calculate character width
|
||||||
for (let i = 0; i < 128; i++) {
|
for (let i = 0; i < 256; i++) {
|
||||||
this.charWidths[i] = this.calculateCharacterWidthAt(bitMap, i % FontRenderer.BITMAP_SIZE, Math.floor(i / FontRenderer.BITMAP_SIZE)) + 2;
|
this.charWidths[i] = this.calculateCharacterWidthAt(bitMap, i % FontRenderer.BITMAP_SIZE, Math.floor(i / FontRenderer.BITMAP_SIZE)) + 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ window.FontRenderer = class {
|
|||||||
let alpha = bitMap[i + 3];
|
let alpha = bitMap[i + 3];
|
||||||
|
|
||||||
// Return width if there is a white pixel
|
// Return width if there is a white pixel
|
||||||
if (red !== 0 || green !== 0 || blue !== 0 || alpha !== 0) {
|
if (red > 1 || green > 1 || blue > 1 || alpha > 1) {
|
||||||
return x - indexX * FontRenderer.FIELD_SIZE;
|
return x - indexX * FontRenderer.FIELD_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user