drawLine / drawVerticalLine issue


#1

I’m having an issue with these functions, the problem is the following:

It looks like coordinate origin in drawLine / drawVerticalLine (int / float coordinates), and drawHorizontalLine looks to be relative to the most top-parent component window rather the current component (the one that “graphic” object belong at time of painting), so I have to add a small offset to the coordinates to match with other graphics functions such as: fillRect, drawImage, etc, because the top application component (document window) have 20 pixel titlebar and a 4 pixel surrouding frame wich bias the graphics origin respect the child component (where all app stuff is done).

Any idea of what I could be doing wrong?

Sorry for my screwed english.


#2

ah - interesting bug. I’ve mucked up a bit of juce_LowLevelGraphicsSoftwareRenderer.cpp

I think these functions need tweaking:

[code]void LowLevelGraphicsSoftwareRenderer::drawVerticalLine (const int x, double top, double bottom, const Colour& col)
{
for (RectangleList::Iterator i (clip); i.next():wink:
{
const Rectangle& r = i.getRectangle();

    clippedDrawVerticalLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
                             x + xOffset, top + yOffset, bottom + yOffset, col);
}

}[/code]

[code]void LowLevelGraphicsSoftwareRenderer::drawHorizontalLine (const int y, double left, double right, const Colour& col)
{
for (RectangleList::Iterator i (clip); i.next():wink:
{
const Rectangle& r = i.getRectangle();

    clippedDrawHorizontalLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
                               y + yOffset, left + xOffset, right + xOffset, col);
}

}[/code]


#3

Indeed, this solved the problem.

Btw: great library and great support. I have to clear some stuff then purchase my license -asap-.


#4

Theres a license? :shock:

seriously though … JUCE is a brilliant library and Jules you should have a PayPal donate setup or something … or perhaps you do and i havent found it?


#5

Theres a license? :shock:

seriously though … JUCE is a brilliant library and Jules you should have a PayPal donate setup or something … or perhaps you do and i havent found it?[/quote]

Feel free to send me envelopes stuffed with used banknotes if you feel like it! The license he’s talking about is the commercial one that you can buy if you want to release a non-open-source product with it.


#6