Hello,
Using the current GIT head (after the iPhone update) drawHorizontalLine() seems to draw in the wrong place.
I have a scope that looks like this (using the GIT from 2009-09-25 1700hrs):
But with the GIT head the faint lines (drawn with drawHorizontalLine()) are in the wrong position:
The waveform is a bit fuzzier too, which is drawn using multiple calls to drawVerticalLine at each horizontal pixel position (not sure if this is related to other Graphics changes but not a major issue like this one). The text is brighter too, look perhaps like everything is drawn twice or perhaps the transparency is working differently.
This test illustrates the drawHorizontalLine problem:
class TestDrawHorizontalLine : public Component
{
public:
TestDrawHorizontalLine () { }
~TestDrawHorizontalLine () { }
void paint (Graphics& g) {
g.fillAll(Colours::black);
g.setColour(Colours::white);
int height = getHeight();
int width = getWidth();
g.drawHorizontalLine(height/2, 0, width);
}
};
class TestDrawLine : public Component
{
public:
TestDrawLine () { }
~TestDrawLine () { }
void paint (Graphics& g) {
g.fillAll(Colours::black);
g.setColour(Colours::white);
int height = getHeight();
int width = getWidth();
g.drawLine(0, height/2, width, height/2);
}
};
class MainComponent : public Component
{
private:
TestDrawHorizontalLine *test1;
TestDrawLine *test2;
public:
MainComponent () {
addAndMakeVisible(test1 = new TestDrawHorizontalLine());
addAndMakeVisible(test2 = new TestDrawLine());
}
~MainComponent () {
deleteAllChildren();
}
void resized () {
test1->setBounds(20, 20, 200, 200);
test2->setBounds(240, 20, 200, 200);
}
};
Both components should look about the same but the first one doesn’t look right. The vertical psoition of the line seems to be dependent on the parent component size.