public void shiftX(double value) { point1.shiftX(value); point2.shiftX(value); point3.shiftX(value); if ((point1.getX() < 0 || point1.getX() > 500) || (point2.getX() < 0 || point2.getX() > 500) || (point3.getX() < 0 || point3.getX() > 500)) { point1.shiftX(-value); point2.shiftX(-value); point3.shiftX(-value); } }
public void shiftX(double value) { point1.shiftX(value); point2.shiftX(value); point3.shiftX(value); point4.shiftX(value); }
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { double shiftvalue = SliderX.Value; if (rectangle != null) { shiftvalue -= rectangle.Left; rectangle.shiftX(shiftvalue); MainCanvas.Children.Clear(); drawRectangle(rectangle); showRectangleInfo(rectangle); } if (triangle != null) { shiftvalue -= triangle.Left; triangle.shiftX(shiftvalue); MainCanvas.Children.Clear(); drawTriangle(triangle); showTriangleInfo(triangle); } if (point != null) { shiftvalue -= point.getTrueX(); point.shiftX(shiftvalue); MainCanvas.Children.Clear(); drawPoint(point); pointX.Text = "X: " + point.getX().ToString("0.00"); } }