On 22.12.2011 21:27, David FLEURY wrote: >> Question: why do you use "USHRT_MAX = 65536" instead of SHRT_MAX (32767), >> as it is in fl_rect.cxx, as you mentioned above? X coordinates can be >> negative, so they are signed shorts AFAICT. Am I missing something? > > > I only USHORT_MAX because this was the value that trigger the issue > for XUtf8DrawString (else it takes int as argument). > I will further tests for negative values (I have done none yet).
Thanks for clarifying that. > You are right, I will see for a Tree Item solution, to avoid regression > somewhere else. Okay. See also Greg's reply (Greg is the author of Fl_Tree). > I do not know well enough fltk to have any opinion on this subject. This clipping (wrapping) problem occurs only on X11, because X11 uses 16-bit coordinates (although the API uses int). Hence, the app shouldn't use coordinates that exceed the 16-bit coordinate space. On all other known platforms this is handled by the OS correctly, but X11 unfortunately "wraps" the extended coordinate space, so we must either avoid using it in the first place (e.g. by clipping at the widget's draw() method), or try to do this in the basic draw methods, which can be tricky to do. The current solution works well for box drawing, but is undefined for all other objects outside the 16-bit range. > Just try to make my tests work for my own configuration. Your input is welcome! Albrecht _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk