Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Sep 4, 2024
1 parent ab44ffd commit 2c64a31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"imports": {
"@oak/oak": "jsr:@oak/oak@^16.1.0",
"simple-icons": "npm:simple-icons@^13.8.0",
"svg-path-bbox": "npm:svg-path-bbox@^2.0.0",
"svg-path-bbox": "npm:svg-path-bbox@^2.1.0",
"svgpath": "npm:svgpath@^2.6.0"
}
}
10 changes: 6 additions & 4 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const resetIconPosition = (path, iconWidth, iconHeight) => {
const betterViewboxWidth = Math.ceil(actualViewboxWidth);
const betterOffset = (betterViewboxWidth - actualViewboxWidth) / 2;
const pathRescale = iconWidth > iconHeight
? svgpath(path).scale(scale).toString()
? svgpath(path).scale(scale)
: path;
const [offsetX, offsetY] = svgPathBbox(pathRescale);
const pathReset = svgpath(pathRescale).translate(
Expand Down

0 comments on commit 2c64a31

Please sign in to comment.