Update of /cvsroot/libufo/ufo-0.5/src/gl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5626/src/gl
Modified Files:
ugl_graphics.cpp
Log Message:
Revoked broken patch for y coord in mapToDevice, mapFromDevice
Index: ugl_graphics.cpp
===================================================================
RCS file: /cvsroot/libufo/ufo-0.5/src/gl/ugl_graphics.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ugl_graphics.cpp 25 Mar 2006 15:51:11 -0000 1.19
--- ugl_graphics.cpp 11 Apr 2006 12:34:36 -0000 1.20
***************
*** 136,148 ****
URectangle
UGL_Graphics::mapToDevice(const URectangle & rect) {
- // FIXME
- // this works only when the graphic viewport was set by the graphics object
- //const UPoint & pos = w->pointToRootPoint(rect.x, rect.y);
-
int vport[4];
ugl_driver->glGetIntegerv(GL_VIEWPORT, vport);
// y-flip
! return URectangle(vport[0] + rect.x, vport[1] + vport[3] - rect.y - rect.h + 1, rect.w, rect.h);
}
--- 136,144 ----
URectangle
UGL_Graphics::mapToDevice(const URectangle & rect) {
int vport[4];
ugl_driver->glGetIntegerv(GL_VIEWPORT, vport);
// y-flip
! return URectangle(vport[0] + rect.x, vport[1] + vport[3] - rect.y - rect.h, rect.w, rect.h);
}
***************
*** 152,159 ****
ugl_driver->glGetIntegerv(GL_VIEWPORT, vport);
- // FIXME
- // this is simply wrong
// y-flip
! return URectangle(rect.x - vport[0], - vport[1] - vport[3] + rect.y + rect.h - 1, rect.w, rect.h);
}
--- 148,153 ----
ugl_driver->glGetIntegerv(GL_VIEWPORT, vport);
// y-flip
! return URectangle(rect.x - vport[0], - vport[1] - vport[3] + rect.y + rect.h, rect.w, rect.h);
}
|