- void renderTiledImage(int globalx, int globaly, int x, int y, int w, int h, PixelBuffer buf) {
- /*
- FIXME
- 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);
- }
- }
- */
- }
-
- void renderText(int x, int y, int clipx, int clipy, int clipw, int cliph, PixelBuffer buf) {
- for(int i=0; i<text.length(); i++) {
- final char c = text.charAt(i);
- Glyph g = Glyph.getCachedGlyph(font, fontsize, c);
- if (g != null) {
- int top = y + g.max_ascent - g.baseline + g.max_descent;
- if (g.p != null)
- buf.drawPictureAlphaOnly(g.p, x, top,
- clipx, clipy, clipx + clipw, clipy + cliph, textcolor);
- x += g.advance;
- } else {
- final int fontsize_final = fontsize;
- final Res font_final = font;
- ThreadMessage.newthread(new JS.Callable() {
- public Object call(JS.Array args) {
- Glyph.renderGlyph(font_final, fontsize_final, c);
- recompute_font();
- Box b = Box.this; MARK_FOR_REFLOW_b;
- dirty();
- return null;
- } });
- return;
- }
- }
- }
-