2 * Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT license.
12 #include "DrawingModeToString.h"
26 Test::SetupClipping(BView
* view
)
28 BRect bounds
= view
->Bounds();
29 fClippingRegion
.Set(bounds
);
30 BRect
grid(bounds
.InsetByCopy(40, 40));
31 for (float y
= grid
.top
; y
< grid
.bottom
+ 5; y
+= grid
.Height() / 2) {
32 for (float x
= grid
.left
; x
< grid
.right
+ 5;
33 x
+= grid
.Width() / 2) {
36 fClippingRegion
.Exclude(r
);
40 view
->ConstrainClippingRegion(&fClippingRegion
);
45 Test::PrintResults(BView
* view
)
47 if (fClippingRegion
.CountRects() > 0)
48 printf("Clipping rects: %ld\n", fClippingRegion
.CountRects());
51 if (ToString(view
->DrawingMode(), string
))
52 printf("Drawing mode: %s\n", string
);