1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /*************************************************************************************************\
- DragTool.cpp : Implementation of the DragTool component.
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- \*************************************************************************************************/
- #include "DragTool.h"
- #include "EditorInterface.h"
- DragTool::DragTool()
- {
- lastX = lastY = -1;
- }
- //-------------------------------------------------------------------------------------------------
- DragTool::~DragTool()
- {
- }
- bool DragTool::beginPaint()
- {
- lastX = lastY = -1;
- return true;
- }
-
- Action* DragTool::endPaint()
- {
- return NULL;
- }
- bool DragTool::paint( Stuff::Vector3D& worldPos, int screenX, int screenY )
- {
- if ( lastX != -1 )
- {
- eye->moveLeft( (screenX - lastX)/eye->getScaleFactor() );
- eye->moveDown( (lastY - screenY)/eye->getScaleFactor() );
- EditorInterface::instance()->syncScrollBars();
- EditorInterface::instance()->SafeRunGameOSLogic();
- }
-
- lastX = screenX;
- lastY = screenY;
- return true;
- }
- //*************************************************************************************************
- // end of file ( DragTool.cpp )
|