path.lineto(int x, int y) Error

hi,

I have written a piece of code which som wat looks like dis.

DrawingArea area = new DrawingArea(400, 100);
Path path =null;

area.addMouseMoveHandler(new MouseMoveHandler() {
@Override
public void onMouseMove(MouseMoveEvent event) {
move(event.getRelativeX(getElement()), event.getRelativeY(getElement()) );
}
});

area.addMouseOutHandler( new MouseOutHandler() {
@Override
public void onMouseOut(MouseOutEvent event) {
path = null;
}
});

private void move(int x, int y) {	
             if(path ==null{
                            path = new Path(x,y);
			path.setFillColor(null);
              }else{

                  //ERROR LINE
              path.lineTo(x, y);	
 }

}

when i try to scribble very fast that is pressing the mouse button and draggin it and den lifting the mouse button i get a GWT exception:

18:33:52.912 [ERROR]
[com.nirav.TestUI]
Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Failed
number: -2147467259
description: Failed
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)

can somone please tell me the reason ?

This happens only with ie8

Hi,

It seems that you have problems with my hobby project - GWT Graphics. That sounds like a like bug in GWT Graphics. Maybe you could file a
new issue
in GWT Graphics issue tracker.

PS. A better place for GWT Graphics related posts would be
GWT Graphics group
under Google groups.

-Henri

Have you tried setting a breakpoint where the error occurs and checking what the x and y values are before calling path.lineTo() ?

Another thing you can try to do is surrounding the path.lineTo() with a try-catch-statement and check what exception is thrown when the error occurs.