favna / hyper-overlay

A complete and customizable solution for a overlay window in your Hyper.app
MIT License
30 stars 9 forks source link

setBounds paramters need a Int value #15

Open imziyang opened 5 years ago

imziyang commented 5 years ago

When the position set to center, maybe caused an error:

TypeError: Error processing argument at index 0, conversion failure from

So I think the code:

this._win.setBounds({x: width / 4, y: height / 4, width: width / 2, height: height / 2}, this._config.animate)

need to be:

this._win.setBounds({x: Math.round(width / 4), y: Math.round(height / 4), width: Math.round(width / 2), height: Math.round(height / 2)}, this._config.animate)
imziyang commented 5 years ago

emm, maybe the code in _startBounds is Math.round not Math.abs