I took the time to write out a test application so this can be easily seen. Rounded rectangles with corner radius of 1, 2, and 3 are filled, stroked, and overlaid. This is the result:
[attachment=0]roundedrectangles.png[/attachment]
And this is the test program:
#include "juce.h"
static void strokePath (Graphics& g,
Path& path,
const PathStrokeType& strokeType,
const AffineTransform& transform = AffineTransform::identity)
{
Path stroke;
strokeType.createStrokedPath (stroke, path, transform, 1.4142136);
g.fillPath (stroke);
}
struct Panel : Component
{
~Panel() { deleteAllChildren(); }
void paint (Graphics& g)
{
g.setColour( Colours::grey );
g.fillAll();
int x=getWidth()/2;
int y=getHeight()/2;
Path p;
p.addRoundedRectangle( -9.5, -12.5, 19, 9, 1 );
p.addRoundedRectangle( -9.5, -0.5, 19, 9, 2 );
p.addRoundedRectangle( -9.5, 12.5, 19, 9, 3 );
g.setColour (Colours::white);
g.fillPath (p,AffineTransform::translation(x,y));
g.fillPath (p,AffineTransform::translation(x-30,y));
g.setColour (Colours::black);
strokePath (g, p, 1, AffineTransform::translation(x,y));
strokePath (g, p, 1, AffineTransform::translation(x+30,y));
}
};
struct MainWindow : DocumentWindow, Button::Listener
{
MainWindow()
: DocumentWindow (JUCE_T("Test")
, Colours::black
, DocumentWindow::allButtons
, true )
{
Panel* p = new Panel;
p->setSize( 512, 384 );
setContentComponent (p, true, true);
centreWithSize (getWidth(), getHeight());
setVisible( true );
}
~MainWindow() {}
void buttonClicked (Button* button)
{
Component* c = getContentComponent()->getChildComponent(1);
c->setVisible (true);
c->setTopLeftPosition (64, 64);
}
void closeButtonPressed() { JUCEApplication::quit(); }
};
struct MainApp : JUCEApplication
{
MainApp() : mainWindow(0) { s_app=this; }
~MainApp() { s_app=0; }
static MainApp& GetInstance() { return *s_app; }
const String getApplicationName() { return JUCE_T("JuceTest"); }
const String getApplicationVersion() { return JUCE_T("0.1.0"); }
bool moreThanOneInstanceAllowed() { return true; }
void anotherInstanceStarted (const String& commandLine) {}
void initialise (const String& commandLine)
{
mainWindow = new MainWindow;
}
void shutdown()
{
delete mainWindow;
}
static MainApp* s_app;
MainWindow* mainWindow;
};
MainApp* MainApp::s_app = 0;
START_JUCE_APPLICATION (MainApp)