MouseOver() public method

public MouseOver ( Vector2 p ) : void
p Vector2
return void
コード例 #1
0
        public override void OnMouseMove(MouseEventArgs mouseEventArgs, int width, int height)
        {
            base.OnMouseMove(mouseEventArgs, width, height);
            if (!mCurrentlyPanning && !mCurrentlyHandlingMouseOver && mTileManager.TiledDatasetLoaded && mTileManager.SegmentationLoaded && !mTileManager.SegmentationChangeInProgress)
            {
                mCurrentlyHandlingMouseOver = true;

                //
                // Mouseover - update display to highlight segment or area under mouse
                // Get the id of the segment under the mouse
                //

                var p = new Vector2((float)mouseEventArgs.X / width, (float)mouseEventArgs.Y / height);

                mTileManager.MouseOver(p);

                if (mCurrentlyDrawing)
                {
                    mTileManager.DrawRegionA(p, mTileManager.MergeBrushSize);
                    mEngine.QuickRender();
                }

                mCurrentlyHandlingMouseOver = false;
            }
        }
コード例 #2
0
        public override void OnMouseMove(MouseEventArgs mouseEventArgs, int width, int height)
        {
            base.OnMouseMove(mouseEventArgs, width, height);
            if (!mCurrentlyPanning && !mCurrentlyHandlingMouseOver && mTileManager.TiledDatasetLoaded && mTileManager.SegmentationLoaded && !mTileManager.SegmentationChangeInProgress)
            {
                mCurrentlyHandlingMouseOver = true;

                //Mouseover - update display to highlight segment or area under mouse
                //Get the id of the segment under the mouse

                var p = new Vector2((float)mouseEventArgs.X / width, (float)mouseEventArgs.Y / height);

                mTileManager.MouseOver(p);

                if (mTileManager.MouseOverSegmentId > 0 && mTileManager.MouseOverSegmentId == mTileManager.SelectedSegmentId)
                {
                    if (mCurrentlyDrawing)
                    {
                        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();
                            }
                        }
                    }
                }

                mCurrentlyHandlingMouseOver = false;
            }
        }