From e79b94c06efaff5248b01c3c4eed52d774941c18 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Sun, 9 Jun 2024 14:43:41 +0530 Subject: [PATCH] fix: corrected hotspot calculation while re-canvasing --- CHANGELOG.md | 4 ++++ src/clickgen/parser/png.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e88dddf..7911d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +### Issue Fixes + +- Fixed hotspot calculation while re-canvasing + ## [v2.2.4] - 05 June 2024 ### What's New? diff --git a/src/clickgen/parser/png.py b/src/clickgen/parser/png.py index d2811cb..4430702 100644 --- a/src/clickgen/parser/png.py +++ b/src/clickgen/parser/png.py @@ -83,13 +83,13 @@ def _parse(self) -> List[CursorFrame]: ) res_img = self._image.resize((size, size), 1) + res_hotspot = self._cal_hotspot(res_img) if size != canvas_size: canvas = Image.new("RGBA", (canvas_size, canvas_size), (0, 0, 0, 0)) canvas.paste(res_img, (0, 0)) res_img = canvas - res_hotspot = self._cal_hotspot(res_img) images.append( CursorImage( image=res_img,