public void HandleMouseWheel(Cursor cursor, int change, PreviewControls previewControls) { float worldX = cursor.GetWorldX(Managers); float worldY = cursor.GetWorldY(Managers); float oldCameraX = Camera.X; float oldCameraY = Camera.Y; float oldZoom = ZoomValue / 100.0f; if (change > 0) { previewControls.ZoomIn(); } else { previewControls.ZoomOut(); } ImageRegionSelectionControl.AdjustCameraPositionAfterZoom(worldX, worldY, oldCameraX, oldCameraY, oldZoom, ZoomValue, Camera); }
public void Initialize(GraphicsDeviceControl graphicsDeviceControl, PreviewControls previewControls) { mPreviewControls = previewControls; mPreviewControls.OnionSkinVisibleChange += new EventHandler(HandleOnionSkinChange); mPreviewControls.SpriteAlignmentChange += new EventHandler(HandleSpriteAlignmentChange); mControl = graphicsDeviceControl; mControl.XnaDraw += new Action(HandleXnaDraw); mControl.MouseWheel += new System.Windows.Forms.MouseEventHandler(HandleMouseWheel); HandleXnaInitialize(); }