mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
corregido doble click en yacreader_flow_gl
This commit is contained in:
parent
779574419e
commit
cb1e0996a3
@ -988,8 +988,31 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
void YACReaderFlowGL::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
{
|
||||
emit selected(centerIndex());
|
||||
event->accept();
|
||||
float x,y;
|
||||
x = event->x();
|
||||
y = event->y();
|
||||
GLint viewport[4];
|
||||
GLdouble modelview[16];
|
||||
GLdouble projection[16];
|
||||
GLfloat winX, winY, winZ;
|
||||
GLdouble posX, posY, posZ;
|
||||
|
||||
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
|
||||
glGetDoublev( GL_PROJECTION_MATRIX, projection );
|
||||
glGetIntegerv( GL_VIEWPORT, viewport );
|
||||
|
||||
winX = (float)x;
|
||||
winY = (float)viewport[3] - (float)y;
|
||||
glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );
|
||||
|
||||
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
|
||||
|
||||
if(posX <= 0.5 && posX >= -0.5)
|
||||
{
|
||||
emit selected(centerIndex());
|
||||
event->accept();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
YACReaderComicFlowGL::YACReaderComicFlowGL(QWidget *parent,struct Preset p )
|
||||
|
Loading…
Reference in New Issue
Block a user