Skip to content

Commit

Permalink
issue-8 parse styled size as a floating point number to avoid exp not…
Browse files Browse the repository at this point in the history
…ation problem (1e+06px)
  • Loading branch information
dhilt committed Apr 19, 2021
1 parent 2906e1e commit dcb14c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/domRoutines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class Routines {
getSizeStyle(element: HTMLElement): number {
this.checkElement(element);
const size = element.style[this.horizontal ? 'width' : 'height'];
return parseInt(size as string, 10) || 0;
return parseFloat(size as string) || 0;
}

setSizeStyle(element: HTMLElement, value: number): void {
Expand Down

0 comments on commit dcb14c5

Please sign in to comment.