Sg2.9
hitTest bug
Recent RSS
hitTest bug
Date:  10. September 2006, 19:28

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

Re: hitTest bug
From:  Jürg Lehni
Date:  29. September 2006, 21:27

Fixed in the upcoming version 2.0.018.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
RandomTools 21.08.08