\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#46: Consistent Overlap Behavior of Area-Defining Canvas Items }
\date{July 18, 2001}
\author{Gerhard Hintermayer}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#46}&\textbf{Consistent Overlap Behavior of Area-Defining Canvas Items }\\\hline
Author&

Gerhard Hintermayer \tipmail{g.hintermayer}{inode.at}
\\
Created&Wednesday, \(\text{18}^{\text{th}}\) July 2001\\
Type&Project\\
Tcl Version&\(8.5\)\\
State&Withdrawn\\
Vote&Pending\\
Version&\tipversion$Revision: 1.5 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

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 \textit{[\$canvas find overlapping]}. Currently polygons behave differently from the rest (rectangle, arc, oval).
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{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 \textit{not} considered to overlap the object. This makes it impossible to
\begin{itemize}
\item{}
define invisible or not filled mouse sensitive areas other than polygons because moving the pointer inside of an arc/oval/rectangle creates both an \textit{\tiplangle{}Enter\tiprangle{}} and a \textit{\tiplangle{}Leave\tiprangle{}} event, even though the pointer is still inside the item.
\item{}
do object-oriented selection on a canvas. Consider you want to select a (not filled) oval, you \textit{have to} click on the vertice, or else you won't find a overlapping item.
\end{itemize}

Well, I see the point, that this proposal might break existing code, but from the number of replies to my postings at \url{news:comp.lang.tcl} , \textit{[\$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.

\section{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, \textit{regardless} of the fill color of the item.

\section{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:

\begin{quote}
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.
\end{quote}

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
