| 1966 | /// |
| 1967 | /// - `h`: coordinate to tile the image along |
| 1968 | public void tileImage(Image img, int x, int y, int w, int h) { |
| 1969 | if (img.requiresDrawImage()) { |
| 1970 | int iW = img.getWidth(); |
| 1971 | int iH = img.getHeight(); |
| 1972 | int clipX = getClipX(); |
| 1973 | int clipW = getClipWidth(); |
| 1974 | int clipY = getClipY(); |
| 1975 | int clipH = getClipHeight(); |
| 1976 | clipRect(x, y, w, h); |
| 1977 | for (int xPos = 0; xPos <= w; xPos += iW) { |
| 1978 | for (int yPos = 0; yPos < h; yPos += iH) { |
| 1979 | int actualX = xPos + x; |
| 1980 | int actualY = yPos + y; |
| 1981 | if (actualX > clipX + clipW) { |
| 1982 | continue; |
| 1983 | } |
| 1984 | if (actualX + iW < clipX) { |
| 1985 | continue; |
| 1986 | } |
| 1987 | if (actualY > clipY + clipH) { |
| 1988 | continue; |
| 1989 | } |
| 1990 | if (actualY + iH < clipY) { |
| 1991 | continue; |
| 1992 | } |
| 1993 | drawImage(img, actualX, actualY); |
| 1994 | } |
| 1995 | } |
| 1996 | setClip(clipX, clipY, clipW, clipH); |
| 1997 | } else { |
| 1998 | impl.tileImage(nativeGraphics, img.getImage(), x + xTranslate, y + yTranslate, w, h); |
| 1999 | } |
| 2000 | } |
| 2001 | |
| 2002 | /// Returns the affine X scale |
| 2003 | /// |