Skip to content

Commit

Permalink
[#17] Fix bug causing bar to be too large
Browse files Browse the repository at this point in the history
  • Loading branch information
arbron committed Sep 4, 2022
1 parent 9f232f1 commit e1fd93b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# [2.2.3]
- Fix issue with bar sizing [[#17]]

# [2.2.2]
- Add support for [D&D 4e] [[#16]]
- Add [Finnish] translation
Expand Down Expand Up @@ -105,9 +108,11 @@
[2.2.0]: https://github.com/arbron/fvtt-hp-bar/compare/2.1.2...2.2.0
[2.2.1]: https://github.com/arbron/fvtt-hp-bar/compare/2.2.0...2.2.1
[2.2.2]: https://github.com/arbron/fvtt-hp-bar/compare/2.2.1...2.2.2
[2.2.3]: https://github.com/arbron/fvtt-hp-bar/compare/2.2.2...2.2.3

[#11]: https://github.com/arbron/fvtt-hp-bar/issues/11
[#16]: https://github.com/arbron/fvtt-hp-bar/issues/16
[#17]: https://github.com/arbron/fvtt-hp-bar/issues/17
[#18]: https://github.com/arbron/fvtt-hp-bar/issues/18

[D&D 3.5e]: https://foundryvtt.com/packages/D35E
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"readme": "https://raw.githubusercontent.com/arbron/fvtt-hp-bar/main/readme.md",
"changelog": "https://raw.githubusercontent.com/arbron/fvtt-hp-bar/main/changelog.md",
"bugs": "https://github.com/arbron/fvtt-hp-bar/issues",
"version": "2.2.2",
"version": "2.2.3",
"minimumCoreVersion": "0.7.9",
"compatibleCoreVersion": "10",
"compatibility": {
Expand Down
4 changes: 3 additions & 1 deletion scripts/systems/default.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default class HPBarBase {

this.w = token.w;
this.h = Math.max((canvas.dimensions.size / 12), 8);
if ( token.height >= 2 ) this.h *= 1.6; // Enlarge the bar for large tokens
const tokenHeight = (game.release?.generation >= 10) ? token.document.height : token.data.height;
console.log(tokenHeight);
if ( tokenHeight >= 2 ) this.h *= 1.6; // Enlarge the bar for large tokens
}


Expand Down

0 comments on commit e1fd93b

Please sign in to comment.