Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!samsung!sdd.hp.com!caen!uflorida!novavax!rm1!rm1.UUCP!vrenjak From: vrenjak@rm1.UUCP (Milan Vrenjak) Newsgroups: comp.windows.x Subject: Re: XDrawRectangle w/ negative width/height? Message-ID: <1014@rm1.UUCP> Date: 8 Feb 91 02:26:47 GMT References: <2124@cs.rit.edu> Sender: news@rm1.UUCP Reply-To: vrenjak@rm1.UUCP (Milan Vrenjak) Organization: Racal-Milgo, Sunrise, Florida Lines: 37 In article <2124@cs.rit.edu>, mxh5795@cs.rit.edu (Michael X Houwers) writes: |> |> |> |> The strange behavior I noticed came when I attempted to rubberband a |> rectangle in any direction which would cause the width or height to |> be negative. If this happened, it appeared that a small corner of |> the old rectangle (I am using GXxor to draw over the old rectangle) |> is not getting redrawn correctly. So as a result, there are lots |> of small corners of rectangles running around the screen. |> |> I looked at the Xlib Reference Manual (from O'Reilly) and found |> no caveats regarding a negative width and/or height. |> |> So, the question is: can you specify a negative width or height for |> a rectangle with no unexpected side effects, and, if that is legal, |> are there any known bugs when doing this? |> |> Any help would be greatly appreciated.. |> |> Thanks, |> mike houwers |> -- I found the same problem on Sun's sparcstation under X11R4. Douglas Young's "The X Window System, Programming and Applications with Xt (OSF/MOTIF Edition)" described that this scenario may happend and inverted the x,y coordinates to make it positive. As to why, this is all I got from p277 - "Some X servers do not draw polygonal figures correctly if the second point is less than the first in either direction. The auxillary function check_points() checks for this case and reverses the coordinates if necessary." ... and shows this function Hope this helps