home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / tcl / 2187 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.1 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Bug fix for arrowheads and "coords" canvas widget command
  5. Date: 21 Dec 1992 18:53:02 GMT
  6. Organization: U.C. Berkeley Sprite Project
  7. Lines: 52
  8. Distribution: world
  9. Message-ID: <1h53qeINNfvt@agate.berkeley.edu>
  10. NNTP-Posting-Host: tyranny.berkeley.edu
  11.  
  12.  
  13. I believe that someone on this list reported a problem with arrowheads
  14. on lines not moving properly after coordinate changes with the "coords"
  15. widget command.  Here is a patch to tkCanvLine.c that should fix the
  16. problem. Please let me know if problems persist.
  17.  
  18. *** /tmp/,RCSt1871260    Mon Dec 21 10:50:21 1992
  19. --- tkCanvLine.c    Mon Dec 21 10:47:12 1992
  20. ***************
  21. *** 42,48 ****
  22.                    * to the necks of the arrowheads rather than
  23.                    * their tips.  The actual endpoints are
  24.                    * stored in the *firstArrowPtr and
  25. !                  * *lastArrowPtr. */
  26.       int width;            /* Width of line. */
  27.       XColor *fg;            /* Foreground color for line. */
  28.       Pixmap fillStipple;        /* Stipple bitmap for filling line. */
  29. --- 42,48 ----
  30.                    * to the necks of the arrowheads rather than
  31.                    * their tips.  The actual endpoints are
  32.                    * stored in the *firstArrowPtr and
  33. !                  * *lastArrowPtr, if they exist. */
  34.       int width;            /* Width of line. */
  35.       XColor *fg;            /* Foreground color for line. */
  36.       Pixmap fillStipple;        /* Stipple bitmap for filling line. */
  37. ***************
  38. *** 367,372 ****
  39. --- 367,389 ----
  40.               != TCL_OK) {
  41.           return TCL_ERROR;
  42.           }
  43. +     }
  44. +     /*
  45. +      * Update arrowheads by throwing away any existing arrow-head
  46. +      * information and calling ConfigureArrows to recompute it.
  47. +      */
  48. +     if (linePtr->firstArrowPtr != NULL) {
  49. +         ckfree((char *) linePtr->firstArrowPtr);
  50. +         linePtr->firstArrowPtr = NULL;
  51. +     }
  52. +     if (linePtr->lastArrowPtr != NULL) {
  53. +         ckfree((char *) linePtr->lastArrowPtr);
  54. +         linePtr->lastArrowPtr = NULL;
  55. +     }
  56. +     if (linePtr->arrow != noneUid) {
  57. +         ConfigureArrows(canvasPtr, linePtr);
  58.       }
  59.       ComputeLineBbox(canvasPtr, linePtr);
  60.       }
  61.  
  62.