src/tracks/labeltrack/ui/LabelTrackView.cpp
/// Draw vertical lines that go exactly through the position
/// of the start or end of a label.
///   @param  dc the device context
///   @param  r  the LabelTrack rectangle.
Draw vertical lines that go exactly through the position
of the start or end of a label.
@param  dc the device context
@param  r  the LabelTrack rectangle.
Draw vertical lines that go exactly through the position of the start or end of a label . @param dc the device context @param r the LabelTrack rectangle .
void LabelTrackView::DrawLines(
   wxDC & dc, const LabelStruct &ls, const wxRect & r)
{
   auto &x = ls.x;
   auto &x1 = ls.x1;
   auto &y = ls.y;
   if (ls.getT0() != ls.getT1()) {
      if (x == x1)
         x1++;
   }
   const int yIconStart = y - (mIconHeight /2)+1+(mTextHeight+3)/2;
   const int yIconEnd   = yIconStart + mIconHeight-2;
   if( y >= 0 )
   {
      if((x  >= r.x) && (x  <= (r.x+r.width)))
      {
         AColor::Line(dc, x, r.y,  x, yIconStart - 1);
         AColor::Line(dc, x, yIconEnd, x, r.y + r.height);
      }
      if((x1 >= r.x) && (x1 <= (r.x+r.width)))
      {
         AColor::Line(dc, x1, r.y,  x1, yIconStart - 1);
         AColor::Line(dc, x1, yIconEnd, x1, r.y + r.height);
      }
   }
   else
   {
      AColor::Line(dc, x, r.y,  x, r.y + r.height);
      AColor::Line(dc, x1, r.y,  x1, r.y + r.height);
   }
}
void LabelTrackView :: DrawLines ( wxDC & dc , const LabelStruct & ls , const wxRect & r ) { auto & x = ls . x ; auto & x1 = ls . x1 ; auto & y = ls . y ; if ( ls . getT0 ( ) != ls . getT1 ( ) ) { if ( x == x1 ) x1 ++ ; } const int yIconStart = y - ( mIconHeight / 2 ) + 1 + ( mTextHeight + 3 ) / 2 ; const int yIconEnd = yIconStart + mIconHeight - 2 ; if ( y >= 0 ) { if ( ( x >= r . x ) && ( x <= ( r . x + r . width ) ) ) { AColor :: Line ( dc , x , r . y , x , yIconStart - 1 ) ; AColor :: Line ( dc , x , yIconEnd , x , r . y + r . height ) ; } if ( ( x1 >= r . x ) && ( x1 <= ( r . x + r . width ) ) ) { AColor :: Line ( dc , x1 , r . y , x1 , yIconStart - 1 ) ; AColor :: Line ( dc , x1 , yIconEnd , x1 , r . y + r . height ) ; } } else { AColor :: Line ( dc , x , r . y , x , r . y + r . height ) ; AColor :: Line ( dc , x1 , r . y , x1 , r . y + r . height ) ; } }
Draw vertical lines that go exactly through the position
of the start or end of a label.
Draw vertical lines that go exactly through the position of the start or end of a label .
// Bug 2388 - Point label and range label can appear identical // If the start and end times are not actually the same, but they  // would appear so when drawn as lines at current zoom, be sure to draw  // two lines - i.e. displace the second line slightly. // How far out from the centre line should the vertical lines // start, i.e. what is the y position of the icon? // We adjust this so that the line encroaches on the icon // slightly (there is white space in the design). // If y is positive then it is the center line for the // Label. // Draw line above and below left dragging widget. // Draw line above and below right dragging widget. // Draw the line, even though the widget is off screen