mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-28 22:14:21 -04:00
⚡ Optimize browser rendering
This commit is contained in:
parent
03d485b5f1
commit
9dbcc585b8
1 changed files with 4 additions and 6 deletions
|
@ -96,9 +96,8 @@ export class BitmapsGenerator {
|
||||||
// Render
|
// Render
|
||||||
spinner.text = ` Rendering ${chalk.greenBright(cursor)}`;
|
spinner.text = ` Rendering ${chalk.greenBright(cursor)}`;
|
||||||
await svgElement.screenshot({ omitBackground: true, path: out });
|
await svgElement.screenshot({ omitBackground: true, path: out });
|
||||||
|
await this.closeAllPages(browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.closeAllPages(browser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,7 +140,7 @@ export class BitmapsGenerator {
|
||||||
// Pushing frames until it match to 1st frame
|
// Pushing frames until it match to 1st frame
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
// Minimum frames no. = 5
|
// Minimum frames no. = 15
|
||||||
while (!breakRendering) {
|
while (!breakRendering) {
|
||||||
const key = getFrameName(index, cursor);
|
const key = getFrameName(index, cursor);
|
||||||
spinner.text = ` Rendering ${chalk.greenBright(key)}`;
|
spinner.text = ` Rendering ${chalk.greenBright(key)}`;
|
||||||
|
@ -156,7 +155,7 @@ export class BitmapsGenerator {
|
||||||
img2Buff: newFrame
|
img2Buff: newFrame
|
||||||
});
|
});
|
||||||
|
|
||||||
if (matched && !normalAnimatedCursors.includes(cursor) && index > 5) {
|
if (matched && !normalAnimatedCursors.includes(cursor) && index > 15) {
|
||||||
breakRendering = true;
|
breakRendering = true;
|
||||||
} else if (matched && index > this.minimumFrames) {
|
} else if (matched && index > this.minimumFrames) {
|
||||||
breakRendering = true;
|
breakRendering = true;
|
||||||
|
@ -167,9 +166,8 @@ export class BitmapsGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saveFrames(frames);
|
this.saveFrames(frames);
|
||||||
|
await this.closeAllPages(browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.closeAllPages(browser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue