mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
New: + CPColor checkerBoardColor for debug use.
This color has a standard 'transparency' checkerboard pattern which is especially useful for our scrolling tests where it makes scrolling easy to visualise. Refs #2078, #2079.
This commit is contained in:
@@ -813,6 +813,12 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
|
||||
return [CPColor colorWithRed:RAND() green:RAND() blue:RAND() alpha:1.0];
|
||||
}
|
||||
|
||||
+ (CPColor)checkerBoardColor
|
||||
{
|
||||
// Thanks to cocco http://stackoverflow.com/a/18368212/76900.
|
||||
return [CPColor colorWithPatternImage:[[CPImage alloc] initWithContentsOfFile:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEX////MzMw46qqDAAAAEElEQVQImWNg+M+AFeEQBgB+vw/xfUUZkgAAAABJRU5ErkJggg=="]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/// @cond IGNORE
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
var scrollView = [self makeScrollview];
|
||||
[scrollView setFrameOrigin:CGPointMake(20,20)]
|
||||
|
||||
[[scrollView documentView] setBackgroundColor:[CPColor checkerBoardColor]];
|
||||
[[scrollView documentView] addSubview:innerScrollView];
|
||||
[[aWindow contentView] addSubview:scrollView];
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
[scrollView setDocumentView:contentView];
|
||||
[contentView2 setAutoresizingMask:CPViewWidthSizable];
|
||||
[contentView2 setBackgroundColor:[CPColor checkerBoardColor]];
|
||||
[scrollView2 setDocumentView:contentView2];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user