ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_x11.c
(Generate patch)

Comparing ray/src/hd/rhd_x11.c (file contents):
Revision 3.38 by greg, Fri Jan 7 20:33:02 2005 UTC vs.
Revision 3.41 by greg, Sun Jul 24 19:53:08 2005 UTC

# Line 190 | Line 190 | dev_open(                      /* initialize X11 driver */
190                                          /* set window manager hints */
191          ourxwmhints.flags = InputHint|IconPixmapHint;
192          ourxwmhints.input = True;
193 <        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay,
194 <                        gwind, x11icon_bits, x11icon_width, x11icon_height);
193 >        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay, gwind,
194 >                        (char *)x11icon_bits, x11icon_width, x11icon_height);
195          XSetWMHints(ourdisplay, gwind, &ourxwmhints);
196          oursizhints.min_width = MINWIDTH;
197          oursizhints.min_height = MINHEIGHT;
# Line 640 | Line 640 | getframe(                              /* get focus frame */
640   )
641   {
642          int     startx = ebut->x, starty = ebut->y;
643 <        int     endx, endy;
644 <
643 >        int     endx, endy, midx, midy;
644 >        FVECT   v1;
645 >        int     li;
646 >                                        /* get mouse drag */
647          XMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent));
648          endx = levptr(XButtonReleasedEvent)->x;
649          endy = levptr(XButtonReleasedEvent)->y;
650 <        if ((endx == startx) | (endy == starty)) {
651 <                XBell(ourdisplay, 0);
650 >        midx = (startx + endx) >> 1;
651 >        midy = (starty + endy) >> 1;
652 >                                        /* set focus distance */
653 >        if ((li = qtFindLeaf(midx, midy)) < 0)
654 >                return;                 /* not on window */
655 >        VCOPY(v1, qtL.wp[li]);
656 >        odev.v.vdist = sqrt(dist2(odev.v.vp, v1));
657 >                                        /* set frame for rendering */
658 >        if ((endx == startx) | (endy == starty))
659                  return;
651        }
660          if (endx < startx) {register int c = endx; endx = startx; startx = c;}
661          if (endy < starty) {register int c = endy; endy = starty; starty = c;}
662          sprintf(odev_args, "%.3f %.3f %.3f %.3f",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines