Re-implement Math.sign so it works on IE 11 (not supported). Square shaped corners for Flyout
This commit is contained in:
1 parent
76ff39605a
commit
50f6b04ed4
2 files changed
+23
-2
No files matched your search
@@ -176,8 +176,15 @@ namespace pxsim {
|
||||
// let it coast to speed 0
|
||||
if (this.speed && !(this.started || this.speedCmd)) {
|
||||
// decay speed 5% per tick
|
||||
this.speed = Math.round(Math.max(0, Math.abs(this.speed) - 10) * Math.sign(this.speed));
|
||||
this.speed = Math.round(Math.max(0, Math.abs(this.speed) - 10) * sign(this.speed));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace pxsim {
|
||||
// A re-implementation of Math.sign (since IE11 doesn't support it)
|
||||
export function sign(num: number) {
|
||||
return num ? num < 0 ? -1 : 1 : 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user