示例#1
0
        public void shiftY(double value)
        {
            point1.shiftY(value);
            point2.shiftY(value);
            point3.shiftY(value);

            if ((point1.getY() < 0 || point1.getY() > 300) || (point2.getY() < 0 || point2.getY() > 300) || (point3.getY() < 0 || point3.getY() > 300))
            {
                point1.shiftY(-value);
                point2.shiftY(-value);
                point3.shiftY(-value);
            }
        }
示例#2
0
 public void shiftY(double value)
 {
     point1.shiftY(value);
     point2.shiftY(value);
     point3.shiftY(value);
     point4.shiftY(value);
 }
示例#3
0
        private void Slider_ValueChanged_1(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            double shiftvalue = SliderY.Value;

            if (rectangle != null)
            {
                shiftvalue -= rectangle.Top;
                rectangle.shiftY(shiftvalue);
                MainCanvas.Children.Clear();
                drawRectangle(rectangle);
                showRectangleInfo(rectangle);
            }

            if (triangle != null)
            {
                shiftvalue -= triangle.Top;
                triangle.shiftY(shiftvalue);
                MainCanvas.Children.Clear();
                drawTriangle(triangle);
                showTriangleInfo(triangle);
            }

            if (point != null)
            {
                shiftvalue -= point.getTrueY();
                point.shiftY(shiftvalue);
                MainCanvas.Children.Clear();
                drawPoint(point);
                pointY.Text = "Y: " + point.getY().ToString("0.00");
            }
        }