public override void OnMouseDown(System.Windows.Forms.MouseEventArgs mouseEventArgs, int width, int height) { base.OnMouseDown(mouseEventArgs, width, height); if (mTileManager.SegmentationLoaded && !mTileManager.SegmentationChangeInProgress && mTileManager.SelectedSegmentId != 0) { // // Draw or erase here // var p = new Vector2((float)mouseEventArgs.X / width, (float)mouseEventArgs.Y / height); mCurrentlyDrawing = true; if (mouseEventArgs.Button == MouseButtons.Left) { mTileManager.DrawRegionA(p); mEngine.QuickRender(); } else if (mouseEventArgs.Button == MouseButtons.Right) { mTileManager.DrawRegionB(p); mEngine.QuickRender(); } } }
public override void OnMouseDown(System.Windows.Forms.MouseEventArgs mouseEventArgs, int width, int height) { base.OnMouseDown(mouseEventArgs, width, height); if (mTileManager.CurrentSplitMode != SplitMode.JoinPoints) { if (mTileManager.SegmentationLoaded && !mTileManager.SegmentationChangeInProgress) { //Get the id of the segment being clicked var p = new Vector2((float)mouseEventArgs.X / width, (float)mouseEventArgs.Y / height); var clickedId = mTileManager.GetSegmentationLabelId(p); if (clickedId == mTileManager.SelectedSegmentId && mTileManager.CurrentSplitMode != SplitMode.JoinPoints) { mCurrentlyDrawing = true; if (mTileManager.CurrentSplitMode == SplitMode.DrawSplit) { if (mouseEventArgs.Button == MouseButtons.Left) { mTileManager.DrawSplit(p); mEngine.QuickRender(); } else if (mouseEventArgs.Button == MouseButtons.Right) { mTileManager.DrawErase(p); mEngine.QuickRender(); } } else if (mTileManager.CurrentSplitMode == SplitMode.DrawRegions) { if (mouseEventArgs.Button == MouseButtons.Left) { mTileManager.DrawRegionA(p); mEngine.QuickRender(); } else if (mouseEventArgs.Button == MouseButtons.Right) { mTileManager.DrawRegionB(p); mEngine.QuickRender(); } } } } } }
public override void OnMouseDown(System.Windows.Forms.MouseEventArgs mouseEventArgs, int width, int height) { base.OnMouseDown(mouseEventArgs, width, height); if (mTileManager.SegmentationLoaded && !mTileManager.SegmentationChangeInProgress) { // // Draw here // var p = new Vector2((float)mouseEventArgs.X / width, (float)mouseEventArgs.Y / height); if (mouseEventArgs.Button == MouseButtons.Left || mouseEventArgs.Button == MouseButtons.Right) { mTileManager.PrepForDrawMerge(p); mCurrentlyDrawing = true; mTileManager.DrawRegionA(p, mTileManager.MergeBrushSize); mEngine.QuickRender(); } } }