TIP #46: Consistent Overlap Behavior of Area-Defining Canvas Items

Title:Consistent Overlap Behavior of Area-Defining Canvas Items
Version:$Revision: 1.5 $
Author:Gerhard Hintermayer <g dot hintermayer at inode dot at>
Created:Wednesday, 18 July 2001


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).


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

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.


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.


This document has been placed in the public domain.

Powered by Tcl[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows