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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user