weird behavior

Wouter wouter.abraham at pi.be
Mon Jul 19 11:05:55 EDT 2004


> weird behavior
> Alex Tweedly alex at tweedly.net
> Mon Jul 19 15:25:14 EDT 2004
>
>

-- another big snip

>
> I'm not convinced. The description above requires that a polygon must 
> meet
> one or other of the two conditions - and many "obvious" polygons will 
> not
> satisfy either condition. No need to invoke the opacity of the polygon.
> Your original example had a non-blank last line containing a point 
> which
> was not a duplicate of the first point - therefore was neither an open 
> nor
> a closed polygon.

This is the difference in looking at things.
Is it the engine that should be conform to the description or is it the 
description that should be conform to the engine?
The Transcript Dictionary is a reworked, updated and elaborated version 
of the metatalk reference. It is a wonderful piece of work, but is it 
infallible?
Anyway, the engine acts in this way.
If you call it to draw a polygon and if the opaque property is set, it 
will consider it as a <closed> one and will check if point 1 = last 
point, if not then add that point.
Your so called "welformed <open> polygons" are in fact <closed> ones if 
the opaque property is set.and the engine gets his way.
Have a look at the points.
  Draw a so called open polygon and add 2 returns for welformed-ness 
sake. Deselect the polygon and reselect it and have a look at the 
points: the so called open polygon is closed now, the first point is 
added.

>
> >The default setting of the opaque property of the templategraphic is 
> true.
> >If not altered all new polygons are of the "closed" type.
> >Setting the opaque property to false for using "open" polygons and to 
> true
> >for "closed" polygons,
> >do you still consider this as a bug or a work around?
>
> Not sure about whether it's a bug or not. As far as I can tell, all
> polygons which meet the description in the dictionary will be either
> "properly closed" or "properly open", and all will be drawn as you'd 
> expect
> - both in opaque and transparent.

What you call properly open in a welformed polygon is in fact a closed 
polygon but it last side is not drawn.
What I call poperly open is a polygon which last points <> first point 
but which can have enclosed regions.


>
> So I'm sure it's a deficiency to leave the definition of polygon so
> (needlessly) amenable to describing malformed ones - but not sure 
> whether
> it's a bug or an opportunity for improvement.

Improvement. :-)


>
> The interaction of closed-ness with the opacity setting seems like a 
> bug.
> If a script supplies a set of points which describe a malformed 
> polygon,
> then that malformed polygon should be treated consistently, regardless 
> of
> whether it is opaque or transparent. (Though of course it's better - 
> and
> perfectly possible - to make it literally impossible to describe a
> malformed polygon.)

I agree that the interaction of closed-ness with the opacity is 
awkward, but  I cannot consider it a real bug.
The improvement would be to add another property that governs open- or 
closed-ness.
And use the opacity for the enclosed regions of the polygon to be 
filled or not.

>
> But I'm sure it could be better described in the documentation. And I'm
> sure that provided you know about malformed polygons (which I didn't 
> until
> this discussion started - thanks) you can easily avoid any problems - 
> so if
> it's a bug, it's a fairly minor one.

Agreed, it is a minor one. :-)

>
> Cheers,
> -- Alex.

Regards,
Wouter



More information about the use-livecode mailing list