Artifact [cf017890f1]

Login

Artifact cf017890f1f08ea7a1d1e7a96b09b64b6baa59e46a41b1614b54854714f7f0f3:


TIP:		46
Title:          Consistent Overlap Behavior of Area-Defining Canvas Items 
Version:        $Revision: 1.5 $
Author:         Gerhard Hintermayer <[email protected]>
State:          Withdrawn
Type:           Project
Vote:           Pending
Created:        18-Jul-2001
Post-History:   
Tcl-Version:	8.5

~ Abstract

This document proposes that all canvas items that define an area
should behave the same in terms of interior points, i.e. points that
return the enclosing object id when submitted to
''[$canvas find overlapping]''.  Currently polygons behave differently
from the rest (rectangle, arc, oval).

~ Rationale

As long as these area-defining canvas items are filled, there's no problem.
The interior points belong to the object. But when the object is not filled
(i.e. -fill "" is used), only polygons consider inside points as overlapping.
For the rest of the area-defining canvas items, an interior point is ''not''
considered to overlap the object.  This makes it impossible to

   * define invisible or not filled mouse sensitive areas other than polygons
     because moving the pointer inside of an arc/oval/rectangle creates both
     an ''<Enter>'' and a ''<Leave>'' event, even though the pointer is still
     inside the item.

   * do object-oriented selection on a canvas. Consider you want to select
     a (not filled) oval, you ''have to'' click on the vertice, or else you
     won't find a overlapping item.

Well, I see the point, that this proposal might break existing code, but
from the number of replies to my postings at news:comp.lang.tcl ,
''[$canvas find overlapping]'' is not used very often.

One possibility to fix the backward compatibility is to introduce 2
different fill colors for the 2 cases - object either hollow or solid
but not filled. Then inside points would not overlap hollow objects, but
would overlap solid objects.

~ Proposal

We should either choose a wire frame model or an object-oriented model
for canvas objects. To my mind an object-oriented approach is better.
Right now we have a mixture of both. Polygons are objects, arcs, ovals and
rectangles are wire frames.

What I'd like is: all points which are inside of an area object should return
the enclosing object when passed to find overlap, ''regardless'' of the fill
color of the item.

~ Notice of Withdrawal

This TIP was Withdrawn by the TIP Editor following discussion on the
tcl-core mailing list.  The following is a summary of reasons for
withdrawal:

 > This would remove useful behaviour that is used rather more often
   than people think.  If people want unfilled polygons with the other
   style of overlap behaviour, they should use lines.

~ Copyright

This document has been placed in the public domain.