drawRectangle Rendering Bug?

This MAY be just an EDGE 830 issue, or a SIMULATOR issue, or a drawRectangle issue? 

In this example, using floating point numbers to try to avoid integer rounding errors....

The box around the LAP data has a BOTTOM of 212.333. And the CONSUME data box has a TOP of 212.333. But they don't overlap. They are rendered at a different pixel location. So the Edge 830, or the simulator, or the drawRectangle function is not handling the numbers for bottom and top the same. Whatever the function does to convert 212.333 to an integer isn't doing it consistently.

  • Maybe I am wrong, but I think that even if you are passing floats to drawRectangle, this function is rounding to zero all four parameters, so for lap box

    botton = 186.666 + 25.666 is actually calculated as 186 + 25 = 211

    and for consume box:

    top = 212

    Does this difference of  1 pixel explain what you observed?

  • It does explain it. And I’ve adapted to the strange implementation… it seems to me rounding to the closest integer makes more sense. But I’ve fixed my rendering logic and all is good. Thx!