GraphLine Refresh Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D.Graphs
Assembly: DeltaEngine.Rendering2D.Graphs (in DeltaEngine.Rendering2D.Graphs.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void Refresh()
Remarks

Tests: DeltaEngine.Rendering2D.Graphs.Tests.GraphLineTests
Examples

3 unit tests call DeltaEngine.Rendering2D.Graphs.GraphLine.Refresh
[Test, CloseAfterFirstFrame]
public void RefreshDoesNothingIfViewportDidntChange()
{
    GraphLine line = CreateLineWithTwoPoints();
    Vector2D start = line.lines[0].StartPoint;
    Vector2D end = line.lines[0].EndPoint;
    line.Refresh();
    Assert.AreEqual(start, line.lines[0].StartPoint);
    Assert.AreEqual(end, line.lines[0].EndPoint);
}
[Test, CloseAfterFirstFrame]
public void RefreshUpdatesLinesIfViewportChanged()
{
    GraphLine line = CreateLineWithTwoPoints();
    line.graph.Viewport = Rectangle.FromCenter(0.4f, 0.4f, 0.8f, 0.8f);
    line.Refresh();
    Assert.IsTrue(line.lines[0].StartPoint.IsNearlyEqual(new Vector2D(0.5f, 0.4762f)));
    Assert.IsTrue(line.lines[0].EndPoint.IsNearlyEqual(new Vector2D(0.5952f, 0.4286f)));
}
[Test]
public void RefreshWillRemoveLines()
{
    GraphLine line = CreateLineWithTwoPoints();
    line.AddValue(0.4f, 4.0f);
    line.lines.Add(new Line2D(Vector2D.Zero, Vector2D.One, Color.Purple));
    line.Refresh();
}
See Also