Example #1
0
void
BarberPole::Draw(BRect r)
{
	if (fStyle == BARBERPOLE_FANCY) {	
		BRect b(Bounds());
		BRect b1;
		for (int i = 0; i < 4; i ++) {
			BRegion r(b);
			if (i != (4-1)) {
				b1 = b.InsetByCopy(1, 1);
				r.Exclude(b1);
			}
			ConstrainClippingRegion(&r);
			BView::SetHighColor(fHighColors[i]); BView::SetLowColor(fLowColors[i]);
			FillRect(b, fStripes);
			b.InsetBy(1, 1);
		}
	} else {
		BView::SetHighColor(fHighColors[4 - 1]);
		BView::SetLowColor(fLowColors[4 - 1]);
		FillRect(r, fStripes);
	}
}