Exemple #1
0
        /// <summary>
        /// Draws overlay.
        /// </summary>
        public void Draw(IEditableFrame Editor, Func <Point, Point> Transform = null)
        {
            if (!_settings.Display)
            {
                return;
            }

            var clickRadius = _settings.Radius;

            var curPos = MouseCursor.CursorPosition;

            if (Transform != null)
            {
                curPos = Transform(curPos);
            }

            var d = clickRadius * 2;

            var x = curPos.X - clickRadius;
            var y = curPos.Y - clickRadius;

            Editor.FillEllipse(_settings.Color, new RectangleF(x, y, d, d));

            var border = _settings.BorderThickness;

            if (border > 0)
            {
                x -= border / 2;
                y -= border / 2;
                d += border;

                Editor.DrawEllipse(_settings.BorderColor, border, new RectangleF(x, y, d, d));
            }
        }
Exemple #2
0
        public void Draw(IEditableFrame Editor, Func <Point, Point> PointTransform = null)
        {
            if (!_settings.DisplayScroll)
            {
                return;
            }

            if (_lastArgs is { } args)
            {
                var p = args.Location;
                var r = _settings.Radius;
                var d = 2 * r;

                Editor.FillEllipse(_settings.ScrollCircleColor, new RectangleF(p.X - r, p.Y - r, d, d));

                var above = new Point(p.X, p.Y + r / 2);
                var below = new Point(p.X, p.Y - r / 2);

                // Scroll down
                if (args.Delta < 0)
                {
                    (above, below) = (below, above);
                }

                Editor.DrawArrow(above, below, _settings.ScrollArrowColor, r / 4f);

                _lastArgs = null;
            }
        }
Exemple #3
0
        public override void Draw(IEditableFrame Editor, Func <Point, Point> PointTransform = null)
        {
            var curPos = Args.Location;

            if (PointTransform != null)
            {
                curPos = PointTransform(curPos);
            }

            float clickRadius = _settings.Radius;

            var d = clickRadius * 2;

            var x = curPos.X - clickRadius;
            var y = curPos.Y - clickRadius;

            var color = GetClickCircleColor();

            Editor.FillEllipse(color, new RectangleF(x, y, d, d));

            var border = _settings.BorderThickness;

            if (border > 0)
            {
                x -= border / 2f;
                y -= border / 2f;
                d += border;

                var borderColor = _settings.BorderColor;

                Editor.DrawEllipse(borderColor, border, new RectangleF(x, y, d, d));
            }

            if (Args.Clicks > 1)
            {
                var font = Editor.GetFont("Arial", 15);
                Editor.DrawString(Args.Clicks.ToString(), font, Color.Black, new RectangleF(x + 10, y + 10, d, d));
            }

            base.Draw(Editor, PointTransform);
        }
Exemple #4
0
        public override void Draw(IEditableFrame Editor, Func <Point, Point> PointTransform)
        {
            var p = Args.Location;

            var r = _settings.Radius;
            var d = 2 * r;

            Editor.FillEllipse(_settings.Color, new RectangleF(p.X - r, p.Y - r, d, d));

            var above = new Point(p.X, p.Y + r / 2);
            var below = new Point(p.X, p.Y - r / 2);

            if (Args.Delta < 0)
            {
                (above, below) = (below, above);
            }

            Editor.DrawArrow(above, below, _settings.BorderColor, r / 4f);

            base.Draw(Editor, PointTransform);
        }
Exemple #5
0
        public void Draw(IEditableFrame Editor, Func <Point, Point> PointTransform = null)
        {
            if (!_settings.Display)
            {
                return;
            }

            if (_clicked && _currentMouseRatio < MouseRatioMax)
            {
                _currentMouseRatio += MouseRatioDeltaUp;

                if (_currentMouseRatio > MouseRatioMax)
                {
                    _currentMouseRatio = MouseRatioMax;
                }
            }
            else if (!_clicked && _currentMouseRatio > MouseRatioMin)
            {
                _currentMouseRatio -= MouseRatioDeltaDown;

                if (_currentMouseRatio < MouseRatioMin)
                {
                    _currentMouseRatio = MouseRatioMin;
                }
            }

            if (_currentMouseRatio > MouseRatioMin)
            {
                var clickRadius = _settings.Radius * _currentMouseRatio;

                var platformServices = ServiceProvider.Get <IPlatformServices>();

                var curPos = platformServices.CursorPosition;

                if (PointTransform != null)
                {
                    curPos = PointTransform(curPos);
                }

                var d = clickRadius * 2;

                var x = curPos.X - clickRadius;
                var y = curPos.Y - clickRadius;

                var color = GetClickCircleColor();

                color = Color.FromArgb(ToByte(color.A * _currentMouseRatio), color);

                Editor.FillEllipse(color, new RectangleF(x, y, d, d));

                var border = _settings.BorderThickness * _currentMouseRatio;

                if (border > 0)
                {
                    x -= border / 2f;
                    y -= border / 2f;
                    d += border;

                    var borderColor = _settings.BorderColor;

                    borderColor = Color.FromArgb(ToByte(borderColor.A * _currentMouseRatio), borderColor);

                    Editor.DrawEllipse(borderColor, border, new RectangleF(x, y, d, d));
                }
            }
        }