Esempio n. 1
0
        public bool OnMouseLeftMove(Point mouse, Keys modifiers, Point imageLocation, float imageZoom)
        {
            if (metadata == null || screenToolManager == null)
            {
                return(false);
            }

            bool handled = false;
            ImageToViewportTransformer transformer = new ImageToViewportTransformer(imageLocation, imageZoom);
            PointF imagePoint = transformer.Untransform(mouse);

            if (screenToolManager.IsUsingHandTool)
            {
                // TODO: handle magnifier.
                handled = screenToolManager.HandTool.OnMouseMove(metadata, imagePoint, Point.Empty, modifiers);
            }
            else
            {
                // Setting second point of a drawing.
                IInitializable drawing = metadata.HitDrawing as IInitializable;
                if (drawing != null)
                {
                    drawing.InitializeMove(imagePoint, modifiers);
                }
            }

            return(handled);
        }