Fixing crash when X Cursor's calculated target number is an integer.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5586f0c214
commit
45f01a9871
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ export default class XCursor extends DrawableObject {
|
|||
if(this.approximate) {
|
||||
approx = (this.targetElement.execute(this.x.execute()))
|
||||
let intLength = Math.round(approx).toString().length
|
||||
let rounding = Math.min(this.rounding, approx.toString().length - intLength - 1)
|
||||
let rounding = Math.max(0, Math.min(this.rounding, approx.toString().length - intLength - 1))
|
||||
approx = approx.toPrecision(rounding + intLength)
|
||||
}
|
||||
return approx
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue