-
- public void drawPicture(Picture source, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) {
- if (!(dx2 - dx1 != sx2 - sx1 || dy2 - dy1 != sy2 - sy1) && ((X11Picture)source).doublebuf != null)
- fastDrawPicture(source, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);
+ public void drawPicture(Picture source, int dx, int dy, int cx1, int cy1, int cx2, int cy2) {
+ cx1 = Math.max(dx, cx1);
+ cy1 = Math.max(dy, cy1);
+ cx2 = Math.min(dx + source.width, cx2);
+ cy2 = Math.min(dy + source.height, cy2);
+ if (cx1 >= cx2 || cy1 >= cy2) return;
+ ((X11Picture)source).init();
+ if (((X11Picture)source).doublebuf != null)
+ fastDrawPicture(source, dx, dy, cx1, cy1, cx2, cy2);