Fix X11 clip region outside 16-bit coordinate space.
This is the first commit of X11 16-bit coordinate space (clipping) fixes. More to follow... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12722 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
ad10e4adaf
commit
12f6285147
@ -143,11 +143,16 @@ int Fl_Xlib_Graphics_Driver::clip_x (int x) {
|
||||
|
||||
// Missing X call: (is this the fastest way to init a 1-rectangle region?)
|
||||
// Windows equivalent exists, implemented inline in win32.H
|
||||
|
||||
// Note: if the entire region is outside the 16-bit X coordinate space an empty
|
||||
// clipping region is returned which means that *nothing* will be visible.
|
||||
|
||||
Fl_Region Fl_Xlib_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) {
|
||||
XRectangle R;
|
||||
clip_to_short(x, y, w, h, line_width_);
|
||||
Fl_Region r = XCreateRegion(); // create an empty region
|
||||
if (clip_to_short(x, y, w, h, line_width_)) // outside X coordinate space
|
||||
return r;
|
||||
R.x = x; R.y = y; R.width = w; R.height = h;
|
||||
Fl_Region r = XCreateRegion();
|
||||
XUnionRectWithRegion(&R, r, r);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user