Definition at line 437 of file Graph.h. References OglGui::DocDimensions::DocH(), OglGui::DocDimensions::DocW(), DoPanning(), DoScaling(), OglGui::DocDimensions::GetDocDimensions(), OglGui::SizableWindow::mAllowMove, OglGui::DocDimensions::mDocH, OglGui::DocDimensions::mDocW, OglGui::DocDimensions::mDocX, OglGui::DocDimensions::mDocY, mLastX, mLastY, mNormX, mNormY, OglGui::Window::MouseFunc(), mPanDifX, mPanDifY, mPanning, mStartTopX, mStartTopY, mZoomable, mZooming, OglGui::DocDimensions::SetDocDimensions(), and StartScalers(). Referenced by MouseFunc(). 00438 { 00439 bool zoomState = (state==(oglLeftButton|oglControl|oglShift)); 00440 bool panState = (state==(oglLeftButton|oglShift)); 00441 if (!zoomState) 00442 mZooming = false; 00443 if (!panState) 00444 mPanning = false; 00445 if (msg == oglMouseDown && btn == oglLeftButton) 00446 { 00447 mZooming = mZoomable ? zoomState : false; 00448 mPanning = mAllowMove ? panState : false; 00449 mStartTopX = mLastX = x; 00450 mStartTopY = mLastY = y; 00451 mNormX = (mStartTopX-mDocX) / (float) DocW(); 00452 mNormY = (mStartTopY-mDocY) / (float) DocH(); 00453 if (mZooming) 00454 StartScalers(); 00455 } 00456 if (!mZooming && !mPanning) 00457 Window::MouseFunc(msg,btn,state,x,y); 00458 if (msg == oglMouseMove && (mZooming||mPanning)) 00459 { 00460 int nX, nY, nW, nH; 00461 GetDocDimensions(nX,nY,nW,nH); 00462 if (mZooming) 00463 { 00464 int difX = mLastX-x; 00465 if ((nW *= (1.0-(difX/100.0)))<12) 00466 nW = 12; 00467 if ((nH *= (1.0-(difX/100.0)))<12) 00468 nH = 12; 00469 nX = mStartTopX - mNormX * nW; 00470 nY = mStartTopY - mNormY * nH; 00471 } 00472 if (mPanning) 00473 { 00474 mPanDifX = mLastX - x; 00475 mPanDifY = mLastY - y; 00476 nX -= mPanDifX; 00477 nY -= mPanDifY; 00478 } 00479 mLastX = x; 00480 mLastY = y; 00481 00482 bool sizeChange = (nW != mDocW || nH != mDocH); 00483 bool posChange = (nX != mDocX || nY != mDocY); 00484 if (posChange || sizeChange) 00485 SetDocDimensions(nX, nY, nW, nH); 00486 if (mZooming && sizeChange) 00487 DoScaling(); 00488 if (mPanning && posChange) 00489 DoPanning(); 00490 } 00491 }
Here is the call graph for this function:
|