On Sat, 2013-09-28 at 03:58 -0300, VinÃcius dos Santos Oliveira wrote:
There are lots of possible errors with floating points and maybe I'm not seeing something here, but you tested the numbers and I wanted to give you confidence to simplify this code. If your test is correct, you are ready to go.
I think so too, thanks for the background on why this sometimes looks odd though.
Maybe his intent was different and there was a special reason to do write this specific pattern, but I doubt (no comments around this code and something too specific to be probable).
The inputs for this particular variable have no precision needed. They refer to literal pixels on the screen (width/height of handle images) and the code divides them in half so that centering calculations later can make sense.
All the numbers are then multiplied by 2 and one added to send that width to the canvas boobly-doo. So I'm pretty safe I think.
Martin,