Fix some UI bugs in graph mode (#862)

* Address issues with error states

* Add various fixes

* Add back initial tooltip

* PR comments
This commit is contained in:
Pepe Rivera
2019-12-12 12:58:28 -08:00
committed by GitHub
parent f282605bc6
commit 2a0637e51c
9 changed files with 58 additions and 25 deletions

View File

@@ -621,10 +621,9 @@ namespace GraphControl
void Grapher::UpdateTracingChanged()
{
if (m_renderMain->Tracing || m_renderMain->ActiveTracing)
if (m_renderMain->Tracing)
{
TracingChangedEvent(true);
TracingValueChangedEvent(m_renderMain->TraceValue);
}
else
@@ -650,11 +649,7 @@ namespace GraphControl
if (m_renderMain)
{
m_renderMain->DrawNearestPoint = false;
if (ActiveTracing == false)
{
// IF we are active tracing we never want to hide the popup..
TracingChangedEvent(false);
}
TracingChangedEvent(false);
e->Handled = true;
}
}

View File

@@ -35,7 +35,7 @@ namespace GraphControl::DX
, m_backgroundColor{ {} }
, m_swapChainPanel{ panel }
, m_TraceValue(Point(0, 0))
, m_TraceLocation(Point(0,0))
, m_TraceLocation(Point(0, 0))
, m_Tracing(false)
, m_ActiveTracingPointRenderer{ &m_deviceResources }
{
@@ -195,6 +195,14 @@ namespace GraphControl::DX
if (!isnan(nearestPointLocation.X) && !isnan(nearestPointLocation.Y))
{
auto lineColors = m_graph->GetOptions().GetGraphColors();
if (formulaId >= 0 && formulaId < lineColors.size())
{
auto dotColor = lineColors[formulaId];
m_nearestPointRenderer.SetColor(D2D1::ColorF(dotColor.R * 65536 + dotColor.G * 256 + dotColor.B, 1.0));
}
m_nearestPointRenderer.Render(nearestPointLocation);
m_Tracing = true;
m_TraceLocation = Point(nearestPointLocation.X, nearestPointLocation.Y);