diff -r d6047ef47a68 -r 633572e14095 javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/HTML5GraphicsEnvironment.java --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/HTML5GraphicsEnvironment.java Mon May 27 10:19:36 2013 +0200 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/HTML5GraphicsEnvironment.java Mon May 27 14:13:01 2013 +0200 @@ -174,13 +174,13 @@ return drawImageImpl(context, nativeImage, sx, sy, sWidth, sHeight, x, y, width, height); } - @JavaScriptBody(args = {"ctx", "img", "x", "y", "width", "height"}, body = "ctx.drawImage(img,x,y,width,height); return img;") + @JavaScriptBody(args = {"ctx", "img", "x", "y", "width", "height"}, body = "img.onload=function(){ctx.drawImage(img,x,y,width,height);};ctx.drawImage(img,x,y,width,height); return img;") private native static Object drawImageImpl(Object ctx, Object img, double x, double y, double width, double height); - @JavaScriptBody(args = {"ctx", "img", "sx", "sy", "swidth", "sheight", "x", "y", "width", "height"}, body = "ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height); return img;") + @JavaScriptBody(args = {"ctx", "img", "sx", "sy", "swidth", "sheight", "x", "y", "width", "height"}, body = "img.onload=function(){ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);}; ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height); return img;") private native static Object drawImageImpl(Object ctx, Object img, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height); - @JavaScriptBody(args = {"ctx", "img", "x", "y"}, body = "ctx.drawImage(img,x,y); return img;") + @JavaScriptBody(args = {"ctx", "img", "x", "y"}, body = "img.onload=function(){ctx.drawImage(img,x,y);}; ctx.drawImage(img,x,y); return img;") private native static Object drawImageImpl(Object ctx, Object img, double x, double y); public Object setFillStyle(Style style, Object nativeStyle) { @@ -233,7 +233,7 @@ "gradient.addColorStop(position,color)") private static native void addColorStopImpl(Object gradient, double position, String color); - @JavaScriptBody(args = {"context", "obj"}, body = "context.fillStyle=obj;") + @JavaScriptBody(args = {"context", "obj"}, body = "console.log('style: '+obj);context.fillStyle=obj;") private native void setFillStyleImpl(Object context, Object obj); @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();") @@ -448,8 +448,8 @@ @JavaScriptBody(args = {"context", "x0", "y0", "r0", "x1", "y1", "r1"}, body = "return context.createRadialGradient(x0,y0,r0,x1,y1,r1);") private static native Object createRadialGradientImpl(Object context, double x0, double y0, double r0, double x1, double y1, double r1); - @JavaScriptBody(args = {"path"}, body = "var b = new Image(); b.src=path; return b;") - public native Image getImageForPath(String path); +// @JavaScriptBody(args = {"path"}, body = "var b = new Image(); b.src=path; return b;") +// public native Image getImageForPathImpl(String path); @Override public int getHeight() {