- VectorGraphics.RasterPath rp = path.realize(a);
- if ((strokecolor & 0xff000000) != 0) rp.stroke(buf, 1, strokecolor);
- if ((fillcolor & 0xff000000) != 0) rp.fill(buf, new VectorGraphics.SingleColorPaint(fillcolor));
- }
-
- // now subtract the pad region from the clip region before proceeding
- if ((flags & NOCLIP_FLAG) == 0) {
- clipw = min(max(clipx, globalx + hpad) + clipw, globalx + width - hpad) - clipx;
- cliph = min(max(clipy, globaly + vpad) + cliph, globaly + height - vpad) - clipy;
- clipx = max(clipx, globalx + hpad);
- clipy = max(clipy, globaly + vpad);
- }
-
- for(Box b = getChild(0); b != null; b = b.nextSibling()) {
- a.translate(b.x, b.y);
- b.render(globalx, globaly, clipx, clipy, clipw, cliph, buf, a);
- a.translate(-1 * b.x, -1 * b.y);
- }
- }
-
- void renderStretchedImage(int globalx, int globaly, int clipx, int clipy, int clipw, int cliph, PixelBuffer buf) {
- // FIXME: wrong
- buf.drawPicture(image, clipx, clipy, clipx + clipw, clipy + cliph, 0, 0, image.getWidth(), image.getHeight());
- }
-
- void renderTiledImage(int globalx, int globaly, int x, int y, int w, int h, PixelBuffer buf) {
- int iw = image.getWidth();
- int ih = image.getHeight();
- for(int i=(x - x)/iw; i <= (x + w - x)/iw; i++) {
- for(int j=(y - y)/ih; j<= (y + h - y)/ih; j++) {
-
- int dx1 = max(i * iw + x, x);
- int dy1 = max(j * ih + y, y);
- int dx2 = min((i+1) * iw + x, x + w);
- int dy2 = min((j+1) * ih + y, y + h);
-
- int sx1 = dx1 - (i*iw) - x;
- int sy1 = dy1 - (j*ih) - y;
- int sx2 = dx2 - (i*iw) - x;
- int sy2 = dy2 - (j*ih) - y;
-
- if (dx2 - dx1 > 0 && dy2 - dy1 > 0 && sx2 - sx1 > 0 && sy2 - sy1 > 0)
- buf.drawPicture(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);