Skip to content

Commit

Permalink
Fix X11 clip region outside 16-bit coordinate space.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Albrecht Schlosser committed Mar 8, 2018
1 parent ad10e4a commit 12f6285
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
Expand Up @@ -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;
}
Expand Down

0 comments on commit 12f6285

Please sign in to comment.