StephenGrider / ElectronCode

135 stars 95 forks source link

Should use Math.round to avoid issue when the width is odd number #8

Closed sundaresan-ve closed 6 years ago

sundaresan-ve commented 6 years ago

https://github.com/StephenGrider/ElectronCode/blob/02c76dd7cbb7c0bfb5851c70e885d7a07971c69a/completed_code/tasky/app/timer_tray.js#L27

We can use Math.round(width/2) to avoid the issue when the width is not an even number. Fractional number in the x co-ordinate will throw an error. In windows, when I tried x=300 it automatically changed that to x=301 during execution and hence I faced this issue.

sundaresan-ve commented 6 years ago

Sorry!! This is a duplicate issue of https://github.com/StephenGrider/ElectronCode/issues/6