ericpaulbishop / gargoyle

Gargoyle Router Management Utility
http://www.gargoyle-router.com
468 stars 221 forks source link

Fix graph overflow in Chromium browsers #722

Closed lantis1008 closed 6 years ago

lantis1008 commented 6 years ago

Graphs on the bandwidth page were overflowing their bounds on some browsers (seems to be Chromium isolated).
From investigation it looks like the browser was occasionally ignoring the division by 100 when calculating the bounds of the graph. By putting this operation in brackets, it appears to fix this behaviour.
Behaviour has only been reported in the last few weeks/months so some upstream update must have caused this. Looked ok to me in the past.
Have not spotted the behaviour on any other graphs, but if it is found to be a problem a similar fix can probably be investigated.

Variable Expected Result Actual Result
graphRightCoor 680 68000
graphBottomCoor 510 51000

badgraph