Gah I just tried to post a bug, attached a file which was larger then 1024kb, and recieved the error: Error in application scriptographer
When this happens you can't go back to see your message..
So here goes another try:
I'm experience some strange exceptions when using hitTest.
It seems that it happens when I hitTest on a point where two paths are close together..
code used:
function onMouseDown(event){ var type = HitTest.TEST_PAINTABLES; var test = activeDocument.hitTest(event.point,type); if(test) print(test); }
Document to test on:
hittest_bug.ai.zip
Try clicking where the vertical line of the b and the bowl of the b are next to each other. Try it a number of times until you get an exception..
Exception recieved:
Wrapped java.lang.IndexOutOfBoundsException: Index: 7, Size: 6 (/Users/synch/Desktop/stuff3/stuff/Code & Research/New Scriptographer scripts/hittest_test.js#3)
org.mozilla.javascript.WrappedException: Wrapped java.lang.IndexOutOfBoundsException: Index: 7, Size: 6 (/Users/synch/Desktop/stuff3/stuff/Code & Research/New Scriptographer scripts/hittest_test.js#3)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1705)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:157)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3082)
at script.onMouseDown(/Users/synch/Desktop/stuff3/stuff/Code & Research/New Scriptographer scripts/hittest_test.js:3)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2248)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:149)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:147)
at com.scriptographer.js.FunctionHelper.callFunction(FunctionHelper.java:61)
at com.scriptographer.ai.Tool.onMouseDown(Tool.java:128)
at com.scriptographer.ai.Tool.onMouseDown(Tool.java:176)
Caused by: java.lang.IndexOutOfBoundsException: Index: 7, Size: 6
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
at com.scriptographer.ai.CurveList.get(CurveList.java:105)
at com.scriptographer.ai.HitTest.(HitTest.java:221)
at com.scriptographer.ai.Document.hitTest(Native Method)
at com.scriptographer.ai.Document.hitTest(Document.java:302)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142)
... 10 more