From cb9c6aef2b2f7523aa7e4a82caff687139fa9374 Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Fri, 6 Nov 2020 10:24:11 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A5=20Minimum=20Frames=20handler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + packages/core/src/BitmapsGenerator.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4de5466d..1724073a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Case insensitive `colors key` replace in **bibata-core** - **Alternate.cur** added in Windows package +- `minimumFrames` frames handler added for animated cursors in **bibata-core** ### Changed diff --git a/packages/core/src/BitmapsGenerator.ts b/packages/core/src/BitmapsGenerator.ts index c3a81941..4c4a875b 100644 --- a/packages/core/src/BitmapsGenerator.ts +++ b/packages/core/src/BitmapsGenerator.ts @@ -15,6 +15,7 @@ import { matchImages } from "./utils/matchImages"; export class BitmapsGenerator { private readonly staticCurs: Cursors; private readonly animatedCurs: Cursors; + private readonly minimumFrames: number = 30; /** * @param source `BitmapsGenerator` Class's object arguments. @@ -151,11 +152,10 @@ export class BitmapsGenerator { img2Buff: newFrame }); - if (matched) { + if (matched && index > this.minimumFrames) { breakRendering = true; } else { frames[key] = { buffer: newFrame }; - setTimeout(() => {}, 1); index++; } }