0000712: Cad Navigation Zoom with Ctrl + causes shapes to pan off screen
This commit is contained in:
parent
87f1e93fea
commit
27de3f76f4
|
@ -59,6 +59,7 @@
|
|||
#include "DemoMode.h"
|
||||
#include "TextureMapping.h"
|
||||
#include "Utilities.h"
|
||||
#include "NavigationStyle.h"
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
|
@ -1817,13 +1818,7 @@ void StdViewZoomIn::activated(int iMsg)
|
|||
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
if ( view ) {
|
||||
View3DInventorViewer* viewer = view->getViewer();
|
||||
|
||||
// send an event to the GL widget to use the internal View3DInventorViewer::zoom() method
|
||||
// do only one step to zoom in
|
||||
SoMouseButtonEvent e;
|
||||
e.setButton(SoMouseButtonEvent::BUTTON5);
|
||||
e.setState(SoMouseButtonEvent::DOWN);
|
||||
viewer->sendSoEvent(&e);
|
||||
viewer->navigationStyle()->zoomIn();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1857,12 +1852,7 @@ void StdViewZoomOut::activated(int iMsg)
|
|||
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
if (view) {
|
||||
View3DInventorViewer* viewer = view->getViewer();
|
||||
// send an event to the GL widget to use the internal View3DInventorViewer::zoom() method
|
||||
// do only one step to zoom out
|
||||
SoMouseButtonEvent e;
|
||||
e.setButton(SoMouseButtonEvent::BUTTON4);
|
||||
e.setState(SoMouseButtonEvent::DOWN);
|
||||
viewer->sendSoEvent(&e);
|
||||
viewer->navigationStyle()->zoomOut();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -721,6 +721,16 @@ void NavigationStyle::zoomByCursor(const SbVec2f & thispos, const SbVec2f & prev
|
|||
zoom(viewer->getCamera(), (thispos[1] - prevpos[1]) * 10.0f/*20.0f*/);
|
||||
}
|
||||
|
||||
void NavigationStyle::zoomIn()
|
||||
{
|
||||
zoom(viewer->getCamera(), -this->zoomStep);
|
||||
}
|
||||
|
||||
void NavigationStyle::zoomOut()
|
||||
{
|
||||
zoom(viewer->getCamera(), this->zoomStep);
|
||||
}
|
||||
|
||||
void NavigationStyle::doZoom(SoCamera* camera, SbBool forward, const SbVec2f& pos)
|
||||
{
|
||||
SbBool zoomAtCur = this->zoomAtCursor;
|
||||
|
|
|
@ -115,6 +115,8 @@ public:
|
|||
void setZoomStep(float);
|
||||
void setZoomAtCursor(SbBool);
|
||||
SbBool isZoomAtCursor() const;
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
|
||||
void updateAnimation();
|
||||
void redraw();
|
||||
|
|
Loading…
Reference in New Issue
Block a user