Skip to content

Commit

Permalink
Merge pull request #249 from fono09/fono/fix-score-broken-opt-half-en…
Browse files Browse the repository at this point in the history
…able

Fix error when opt.half == true
  • Loading branch information
wbotelhos authored Aug 23, 2023
2 parents 4c5c5b3 + c918537 commit 6037616
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/raty.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ class Raty {

if (this.opt.half) {
const size = this._getWidth();
const percent = parseFloat((evt.pageX - icon.offsetLeft) / size);
const percent = parseFloat((evt.pageX - icon.getBoundingClientRect().x) / size);

score = score - 1 + percent;
}
Expand Down

0 comments on commit 6037616

Please sign in to comment.