Skip to content

Commit

Permalink
Merge pull request #5747 from msed21/main
Browse files Browse the repository at this point in the history
Fix issue #5702
  • Loading branch information
limzykenneth authored Aug 1, 2022
2 parents 9cffb21 + 94b83c7 commit f711e31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1993,8 +1993,8 @@ p5.Element.prototype.style = function(prop, val) {
) {
let styles = window.getComputedStyle(self.elt);
let styleVal = styles.getPropertyValue(prop);
let numVal = styleVal.replace(/\D+/g, '');
this[prop] = parseInt(numVal, 10);
let numVal = styleVal.replace(/[^\d.]/g, '');
this[prop] = Math.round(parseFloat(numVal, 10));
}
}
return this;
Expand Down

0 comments on commit f711e31

Please sign in to comment.