mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fix savegame crash
This commit is contained in:
parent
a2b1342f55
commit
b05182a1cc
@ -851,7 +851,7 @@ export function formatSecondsToTimeAgo(secs) {
|
|||||||
if (hours <= 1) {
|
if (hours <= 1) {
|
||||||
return "one hour ago";
|
return "one hour ago";
|
||||||
}
|
}
|
||||||
return hours + " hour ago";
|
return hours + " hours ago";
|
||||||
} else {
|
} else {
|
||||||
if (days <= 1) {
|
if (days <= 1) {
|
||||||
return "one day ago";
|
return "one day ago";
|
||||||
|
@ -29,7 +29,7 @@ export class ColorItem extends BaseItem {
|
|||||||
constructor(color) {
|
constructor(color) {
|
||||||
super();
|
super();
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.bufferGenerator = this.internalGenerateColorBuffer.bind(this);
|
this.bufferGenerator = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getBackgroundColorAsResource() {
|
getBackgroundColorAsResource() {
|
||||||
@ -43,6 +43,10 @@ export class ColorItem extends BaseItem {
|
|||||||
* @param {DrawParameters} parameters
|
* @param {DrawParameters} parameters
|
||||||
*/
|
*/
|
||||||
draw(x, y, parameters, size = 12) {
|
draw(x, y, parameters, size = 12) {
|
||||||
|
if (!this.bufferGenerator) {
|
||||||
|
this.bufferGenerator = this.internalGenerateColorBuffer.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
const dpi = smoothenDpi(globalConfig.shapesSharpness * parameters.zoomLevel);
|
const dpi = smoothenDpi(globalConfig.shapesSharpness * parameters.zoomLevel);
|
||||||
|
|
||||||
const key = size + "/" + dpi;
|
const key = size + "/" + dpi;
|
||||||
|
Loading…
Reference in New Issue
Block a user