Show
Ignore:
Timestamp:
08/22/14 21:00:53 (7 hours ago)
Author:
robert
Message:

Improved handling of setting of the depth of the UI.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgWidget/Widget.cpp

    r13041 r13376  
    512512 
    513513    point_type X = ((x / getWidth()) * width) + (*texs)[LL].x(); 
    514     point_type Y = (((getHeight() - y) / getHeight()) * height) + (*texs)[UR].y(); 
     514    point_type Y = ((y / getHeight()) * height) + (*texs)[LR].y(); 
     515     
     516    if (X<0.0 || X>1.0 || Y<0.0 || Y>1.0)  
     517    { 
     518        OSG_INFO<<"Widget::getImageColorAtXY("<<x<<", "<<y<<") Texture coordinate out of range, X="<<X<<", Y="<<Y<<std::endl; 
     519        return Color(); 
     520    } 
    515521 
    516522    return image->getColor(TexCoord(X, Y));