[Etoys] setVertexCount (Star and now Polygon morph)
peace_the_dreamer at yahoo.com
Mon Mar 2 21:01:54 EST 2009
Hi Yoshiki and crew.
I am in the middle of looking into Hayashi-san's fixes.
Adding setVertexCount: to polygon has some nice features.
It actually does solve the problem of adding to one vertex.
Also I haven't yet seen the problems crop up with one vertex morphs
raising debug problems.
On the other hand since I was looking at it I put on my Fearless-Bug Tracker hat. And called on my imaginative* trouble making assistant Puck.
We observed the following. Currently (before patching) say you set the number of star vertices to something odd like 9 . What happens the second time you execute the assignment.
Also when I repaired stars I chose to make sure there were a minimum of
two points (4 vertices). Currently using the assignment you can set star to have 2 vertices. This was interesting in a Papert sort of way**.
So I let Puck take over. He tried setting the star to -6 vertices.
And smiled ear to ear as we got a wonderful crash.
Debug boxes, an emergency evaluator and of course the star was invalidated.
I haven't tried yet but I suspect that similar things can happen to polygons that way.
I don't think this invalidates Hayashi-san's fixes. It does point to some tightening up being required in what gets passed along from the tile scripts.
I also think it would be cool to have a triangle handle appear when you are down to one vertex. So I still recommend combining the two repairs with some extra-bulletproofing thrown in to prevent puckish mischief.
Yours in curiosity and service, --Jerome Peace
*(Puck insists I NOT call him my imaginary assistant)
**(There are no wrong results only interesting outcomes -- Seymour Papert somewhat paraphrased and folk processed)
More information about the etoys-dev