Warning: session_start(): open(/var/lib/php/sessions/sess_trk1h4rh14ipkhulh8e8qfj3dp, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass CheckerBoard2 is G2Drawable {
settable int w = 256;
settable int h = 256;
settable double shiftX;
settable double shiftY;
settable double cellW = 8;
settable double cellH = 8;
settable Color color1 = Color.lightGray;
settable Color color2 = Color.gray;
selfType cellSize(double cellSize) {
ret cellW(cellSize).cellH(cellSize);
}
public int getWidth() { ret w; }
public int getHeight() { ret h; }
public void drawOn(Graphics2D g) {
int xofs = idiv_floor(shiftX, cellW);
int yofs = idiv_floor(shiftY, cellH);
double x1 = mod(shiftX, cellW)-cellW;
double y1 = mod(shiftY, cellH)-cellH;
bool bRow = odd(yofs^xofs);
for (double y = y1; y < h; y += cellH) {
bRow = !bRow;
bool b = bRow;
for (double x = x1; x < w; x += cellW) {
b = !b;
g.setColor(b ? color1 : color2);
g.fill(new Rectangle2D.Double(x, y, cellW, cellH));
}
}
}
}