home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!sprite.Berkeley.EDU!ouster
- From: ouster@sprite.Berkeley.EDU (John Ousterhout)
- Newsgroups: comp.lang.tcl
- Subject: Bug fix for arrowheads and "coords" canvas widget command
- Date: 21 Dec 1992 18:53:02 GMT
- Organization: U.C. Berkeley Sprite Project
- Lines: 52
- Distribution: world
- Message-ID: <1h53qeINNfvt@agate.berkeley.edu>
- NNTP-Posting-Host: tyranny.berkeley.edu
-
-
- I believe that someone on this list reported a problem with arrowheads
- on lines not moving properly after coordinate changes with the "coords"
- widget command. Here is a patch to tkCanvLine.c that should fix the
- problem. Please let me know if problems persist.
-
- *** /tmp/,RCSt1871260 Mon Dec 21 10:50:21 1992
- --- tkCanvLine.c Mon Dec 21 10:47:12 1992
- ***************
- *** 42,48 ****
- * to the necks of the arrowheads rather than
- * their tips. The actual endpoints are
- * stored in the *firstArrowPtr and
- ! * *lastArrowPtr. */
- int width; /* Width of line. */
- XColor *fg; /* Foreground color for line. */
- Pixmap fillStipple; /* Stipple bitmap for filling line. */
- --- 42,48 ----
- * to the necks of the arrowheads rather than
- * their tips. The actual endpoints are
- * stored in the *firstArrowPtr and
- ! * *lastArrowPtr, if they exist. */
- int width; /* Width of line. */
- XColor *fg; /* Foreground color for line. */
- Pixmap fillStipple; /* Stipple bitmap for filling line. */
- ***************
- *** 367,372 ****
- --- 367,389 ----
- != TCL_OK) {
- return TCL_ERROR;
- }
- + }
- +
- + /*
- + * Update arrowheads by throwing away any existing arrow-head
- + * information and calling ConfigureArrows to recompute it.
- + */
- +
- + if (linePtr->firstArrowPtr != NULL) {
- + ckfree((char *) linePtr->firstArrowPtr);
- + linePtr->firstArrowPtr = NULL;
- + }
- + if (linePtr->lastArrowPtr != NULL) {
- + ckfree((char *) linePtr->lastArrowPtr);
- + linePtr->lastArrowPtr = NULL;
- + }
- + if (linePtr->arrow != noneUid) {
- + ConfigureArrows(canvasPtr, linePtr);
- }
- ComputeLineBbox(canvasPtr, linePtr);
- }
-
-