Help placing more than 85 words

120 views
Skip to first unread message

mike

unread,
Aug 6, 2013, 2:47:45 PM8/6/13
to word...@googlegroups.com
I have wordCram running as an applet and seems to work well unless I try to place more than 85 words.
Here's the main I'm using for wordcram:
https://gist.github.com/ultrapants/d6c51ed7726c63b60821
And here is the html test page I'm using for the applet:


I'm getting an NPE in Animation Thread at BBTreeBuilder.makeTree  - line 32.


Here's the full stack trace:

Exception in thread "Animation Thread" java.lang.NullPointerException
at wordcram.BBTreeBuilder.makeTree(BBTreeBuilder.java:32)
at wordcram.EngineWord.setShape(EngineWord.java:44)
at wordcram.WordCramEngine.wordsIntoEngineWords(WordCramEngine.java:79)
at wordcram.WordCramEngine.<init>(WordCramEngine.java:55)
at wordcram.WordCram.getWordCramEngine(WordCram.java:788)
at wordcram.WordCram.drawAll(WordCram.java:838)
at executable.Main.draw(Main.java:192)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


This is very curious to me, since the way I'm using wordCram works without fail for 85 or fewer words, but gets this NPE at 86 words or above. Any help would be greatly appreciated. Thanks a lot in advance!

Dan Bernier

unread,
Aug 10, 2013, 2:28:09 PM8/10/13
to mike, word...@googlegroups.com
That's odd. Which version of WordCram are you using?


--
You received this message because you are subscribed to the Google Groups "WordCram" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wordcram+u...@googlegroups.com.
To post to this group, send email to word...@googlegroups.com.
 
 



--
twitter @danbernier
http://wordcram.org | http://newhavenrb.org

Dan Bernier

unread,
Aug 10, 2013, 3:14:19 PM8/10/13
to mike, word...@googlegroups.com
I found the problem, running with 0.5.7: you're setting minShapeSize to zero. If you set it higher, even to 1, it should work.

Setting it to zero means that you want to render any word shapes, even if they're less than 1 pixel wide or high, and it looks like the bounding box trees can't handle such small shapes.

I'll put in a bug fix for the 0.6.0 release to limit minShapeSize to 1 or greater.

Dan Bernier

unread,
Aug 10, 2013, 3:19:20 PM8/10/13
to mike, word...@googlegroups.com
(Actually, to be precise, the cause was that you were setting minShapeSize to zero, and using Sizers.byWeight(0, 30). If you set the lower bound on the Sizer to be 1, it'll fix the problem, too.)
Reply all
Reply to author
Forward
0 new messages