Exemplo n.º 1
0
        private bool CheckTopAxis(int x, int y)
        {
            float leftX = _tAxis.GetPoint1()[0];  //x-position of left point
            float leftY = _tAxis.GetPoint1()[1];  //y-position of left point

            float rightX = _tAxis.GetPoint2()[0]; //x-position of right point
            float rightY = _tAxis.GetPoint2()[1]; //y-position of right point

            if (x - leftX < PIXEL_RADIUS && x - leftX > -PIXEL_RADIUS && y > leftY)
            {
                _currentAxis          = _tAxis;
                _textBox.DataEntered += ModifyMinimumValue;
                SetupTextBox();

                return(true);
            }
            else if (x - rightX < PIXEL_RADIUS && x - rightX > -PIXEL_RADIUS && y > rightY)
            {
                _currentAxis          = _tAxis;
                _textBox.DataEntered += ModifyMaximumValue;
                SetupTextBox();

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool CheckRightAxis(int x, int y)
        {
            float bottomX = _rAxis.GetPoint1()[0]; //x-position of bottom point
            float bottomY = _rAxis.GetPoint1()[1]; //y-position of bottom point

            float topX = _rAxis.GetPoint2()[0];    //x-position of top point
            float topY = _rAxis.GetPoint2()[1];    //y-position of top point

            if (x > bottomX && y - bottomY < PIXEL_RADIUS && y - bottomY > -PIXEL_RADIUS)
            {
                _currentAxis          = _rAxis;
                _textBox.DataEntered += ModifyMinimumValue;
                SetupTextBox();

                return(true);
            }
            else if (x > topX && y - topY < PIXEL_RADIUS && y - topY > -PIXEL_RADIUS)
            {
                _currentAxis          = _rAxis;
                _textBox.DataEntered += ModifyMaximumValue;
                SetupTextBox();

                return(true);
            }

            return(false);
        }