Bug in graphics::drawline()


#1

Hi,

here is a magnified screenshot of the problem :

on the left, I used Graphics::drawLine(float startX, float startY, float endX, float endY)

on the right, I used Graphics::drawLine (const float startX, const float startY, const float endX, const float endY, const float lineThickness)
with lineThickness = 1.0f

the two functions don’t produce the same result,
moreover some blue pixels appear when the slope is > 1.
I only tried this on windows,

Maybe some pixels values are going too far and the blue value is coming from the next one. this could make sense on win32 cause it is in the BGRA order …

here is the source code for an example - just use it instead of the Hello world’s main.cpp
here is the executable, in case you want to try this at home.


#2

In fact, I’d just spotted that one myself, it’s a typo in juce_LowLevelGraphicsRenderer.cpp, line 1973 should be:

((PixelRGB*) dest)->blend (colour, roundDoubleToInt (255.0 * (1.0 - (top - wholeStart))));

So just needs the “A” removing from “PixelARGB”. I was hoping nobody would notice until the next release…


#3