mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-19 19:14:42 +00:00
Wheel event are now passed to the active edit plugin. As a consequence an edit plugin can now change the behaviour of the wheel and when an edit is active you cannot zoom anymore...
This commit is contained in:
parent
64f97b3d5b
commit
3c6652dd2f
@ -812,26 +812,33 @@ void GLArea::tabletEvent(QTabletEvent*e)
|
||||
|
||||
void GLArea::wheelEvent(QWheelEvent*e)
|
||||
{
|
||||
setFocus();
|
||||
const int WHEEL_STEP = 120;
|
||||
float notch = e->delta()/ float(WHEEL_STEP);
|
||||
switch(e->modifiers())
|
||||
{
|
||||
case Qt::ShiftModifier + Qt::ControlModifier : clipRatioFar = math::Clamp( clipRatioFar*powf(1.2f, notch),0.01f,5000.0f); break;
|
||||
case Qt::ControlModifier : clipRatioNear = math::Clamp(clipRatioNear*powf(1.2f, notch),0.01f,50.0f); break;
|
||||
setFocus();
|
||||
if( (iEdit && !suspendedEditor) )
|
||||
{
|
||||
iEdit->wheelEvent(e,*mm(),this);
|
||||
}
|
||||
else
|
||||
{
|
||||
const int WHEEL_STEP = 120;
|
||||
float notch = e->delta()/ float(WHEEL_STEP);
|
||||
switch(e->modifiers())
|
||||
{
|
||||
case Qt::ShiftModifier + Qt::ControlModifier : clipRatioFar = math::Clamp( clipRatioFar*powf(1.2f, notch),0.01f,5000.0f); break;
|
||||
case Qt::ControlModifier : clipRatioNear = math::Clamp(clipRatioNear*powf(1.2f, notch),0.01f,50.0f); break;
|
||||
case Qt::AltModifier : glas.pointSize = math::Clamp(glas.pointSize*powf(1.2f, notch),0.01f,150.0f);
|
||||
foreach(MeshModel * mp, this->md()->meshList)
|
||||
mp->glw.SetHintParamf(GLW::HNPPointSize,glas.pointSize);
|
||||
break;
|
||||
case Qt::ShiftModifier : fov = math::Clamp(fov+1.2f*notch,5.0f,90.0f); break;
|
||||
default:
|
||||
break;
|
||||
case Qt::ShiftModifier : fov = math::Clamp(fov+1.2f*notch,5.0f,90.0f); break;
|
||||
default:
|
||||
if(isRaster())
|
||||
this->opacity = math::Clamp( opacity*powf(1.2f, notch),0.1f,1.0f);
|
||||
else
|
||||
trackball.MouseWheel( e->delta()/ float(WHEEL_STEP));
|
||||
break;
|
||||
}
|
||||
update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user