Skip to content

Commit

Permalink
Fix display of angle when showing the EBL info all the time
Browse files Browse the repository at this point in the history
in OpenGL
  • Loading branch information
jongough committed Jan 15, 2017
1 parent 2a0a1f1 commit ae461de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/EBL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,13 @@ void EBL::Draw( ODDC& dc, PlugIn_ViewPort &VP )
ODPath::Draw( dc, VP );

if(m_bAlwaysShowInfo) {
ODPoint *pStartPoint = m_pODPointList->GetFirst()->GetData();
ODPoint *pEndPoint = m_pODPointList->GetLast()->GetData();
double brg, dlength;
DistanceBearingMercator_Plugin(pStartPoint->m_lat, pStartPoint->m_lon, pEndPoint->m_lat, pEndPoint->m_lon, &brg, &dlength);
wxPoint l_Point;
GetCanvasPixLL( &VP, &l_Point, pEndPoint->m_lat, pEndPoint->m_lon);
wxString info = g_ocpn_draw_pi->CreateExtraPathLegInfo(dc, this, m_dEBLAngle, m_dLength, l_Point);
wxString info = g_ocpn_draw_pi->CreateExtraPathLegInfo(dc, this, brg, dlength, l_Point);
if(info.length() > 0)
g_ocpn_draw_pi->RenderExtraPathLegInfo( dc, l_Point, info );
}
Expand All @@ -458,10 +461,13 @@ void EBL::DrawGL( PlugIn_ViewPort &piVP )
ODPath::DrawGL( piVP );

if(m_bAlwaysShowInfo) {
ODPoint *pStartPoint = m_pODPointList->GetFirst()->GetData();
ODPoint *pEndPoint = m_pODPointList->GetLast()->GetData();
double brg, dlength;
DistanceBearingMercator_Plugin(pStartPoint->m_lat, pStartPoint->m_lon, pEndPoint->m_lat, pEndPoint->m_lon, &brg, &dlength);
wxPoint l_Point;
GetCanvasPixLL( &piVP, &l_Point, pEndPoint->m_lat, pEndPoint->m_lon);
wxString info = g_ocpn_draw_pi->CreateExtraPathLegInfo(dc, this, m_dEBLAngle, m_dLength, l_Point);
wxString info = g_ocpn_draw_pi->CreateExtraPathLegInfo(dc, this, brg, dlength, l_Point);
if(info.length() > 0)
g_ocpn_draw_pi->RenderExtraPathLegInfo( dc, l_Point, info );
}
Expand Down

0 comments on commit ae461de

Please sign in to comment.