Unit constants was added

This commit is contained in:
Evgeny Redikultsev
2022-11-13 20:12:28 +05:00
parent 1e98e2cc57
commit e68ae14963
18 changed files with 152 additions and 40 deletions

View File

@@ -160,6 +160,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
private double crossLineY;
private double sumAboveLine;
private double sumUnderLine;
private Line previosLine;
const int RangeNumber = 16;
public FieldViewerViewModel()
@@ -311,16 +312,16 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
if (crossLineX == 0d)
{
line.X1 = - width / 2d - dX;
line.Y1 = - crossLineY - dY;
line.Y1 = - crossLineY + dY;
line.X2 = width / 2d - dX;
line.Y2 = - crossLineY - dY;
line.Y2 = - crossLineY + dY;
}
else if (crossLineY == 0d)
{
line.X1 = crossLineX - dX;
line.Y1 = heigth / 2 - dY;
line.Y1 = heigth / 2 + dY;
line.X2 = crossLineX - dX;
line.Y2 = -heigth / 2 - dY;
line.Y2 = -heigth / 2 + dY;
}
else
{
@@ -334,6 +335,12 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
line.Fill = brush;
line.Stroke = brush;
line.StrokeThickness = (width + heigth) / 100;
if (previosLine != null)
{
try { WorkPlaneCanvas.Children.Remove(previosLine);}
catch (Exception) {}
}
previosLine = line;
WorkPlaneCanvas.Children.Add(line);
}
private double GetPointOfCrossLine(double x)