@@ -385,8 +385,7 @@ Rectangle<float> CartesianPlane::getPlotBounds() const
385385 static_cast <float > (marginLeft),
386386 static_cast <float > (marginTop),
387387 static_cast <float > (bounds.getWidth () - marginLeft - marginRight),
388- static_cast <float > (bounds.getHeight () - marginTop - marginBottom)
389- );
388+ static_cast <float > (bounds.getHeight () - marginTop - marginBottom));
390389}
391390
392391// ==============================================================================
@@ -403,7 +402,7 @@ void CartesianPlane::paint (Graphics& g)
403402 drawAxisLabels (g, plotBounds);
404403 drawTitle (g);
405404
406- if (showLegend && !signals.empty ())
405+ if (showLegend && ! signals.empty ())
407406 drawLegend (g, plotBounds);
408407}
409408
@@ -453,12 +452,12 @@ void CartesianPlane::drawSignals (Graphics& g, const Rectangle<float>& bounds)
453452{
454453 for (const auto & signal : signals)
455454 {
456- if (!signal.visible || signal.data .empty ())
455+ if (! signal.visible || signal.data .empty ())
457456 continue ;
458457
459458 g.setStrokeColor (signal.color );
460459 g.setStrokeWidth (signal.strokeWidth );
461-
460+
462461 Path path;
463462 bool firstPoint = true ;
464463 Point<float > previousPoint;
@@ -468,10 +467,10 @@ void CartesianPlane::drawSignals (Graphics& g, const Rectangle<float>& bounds)
468467 {
469468 float x = valueToX (point.getX ());
470469 float y = valueToY (point.getY ());
471-
470+
472471 Point<float > currentPoint (x, y);
473472 bool currentPointInBounds = bounds.contains (currentPoint);
474-
473+
475474 // Handle visibility and path continuity
476475 if (currentPointInBounds)
477476 {
@@ -480,7 +479,7 @@ void CartesianPlane::drawSignals (Graphics& g, const Rectangle<float>& bounds)
480479 path.startNewSubPath (x, y);
481480 firstPoint = false ;
482481 }
483- else if (previousPointValid && !bounds.contains (previousPoint))
482+ else if (previousPointValid && ! bounds.contains (previousPoint))
484483 {
485484 // Previous point was outside, current is inside - find intersection and start new subpath
486485 auto intersection = findBoundsIntersection (previousPoint, currentPoint, bounds);
@@ -508,12 +507,12 @@ void CartesianPlane::drawSignals (Graphics& g, const Rectangle<float>& bounds)
508507 path.lineTo (intersection->getX (), intersection->getY ());
509508 }
510509 }
511-
510+
512511 previousPoint = currentPoint;
513512 previousPointValid = true ;
514513 }
515514
516- if (!firstPoint)
515+ if (! firstPoint)
517516 g.strokePath (path);
518517 }
519518}
@@ -533,8 +532,7 @@ void CartesianPlane::drawAxisLabels (Graphics& g, const Rectangle<float>& bounds
533532 static_cast <int > (x - 30 ),
534533 static_cast <int > (bounds.getBottom () + 2 ),
535534 60 ,
536- marginBottom - 2
537- );
535+ marginBottom - 2 );
538536
539537 g.fillFittedText (label.text , font, labelBounds, Justification::center);
540538 }
@@ -553,8 +551,7 @@ void CartesianPlane::drawAxisLabels (Graphics& g, const Rectangle<float>& bounds
553551 2 ,
554552 static_cast <int > (y - 8 ),
555553 marginLeft - 4 ,
556- 16
557- );
554+ 16 );
558555
559556 g.fillFittedText (label.text , font, labelBounds, Justification::right);
560557 }
@@ -572,8 +569,7 @@ void CartesianPlane::drawTitle (Graphics& g)
572569 marginLeft,
573570 2 ,
574571 getWidth () - marginLeft - marginRight,
575- marginTop - 4
576- );
572+ marginTop - 4 );
577573
578574 g.fillFittedText (titleText, titleFont, titleBounds, titleJustification);
579575}
@@ -584,7 +580,7 @@ void CartesianPlane::drawLegend (Graphics& g, const Rectangle<float>& bounds)
584580 int visibleSignalCount = 0 ;
585581 for (const auto & signal : signals)
586582 {
587- if (signal.visible && !signal.name .isEmpty ())
583+ if (signal.visible && ! signal.name .isEmpty ())
588584 visibleSignalCount++;
589585 }
590586
@@ -622,7 +618,7 @@ void CartesianPlane::drawLegend (Graphics& g, const Rectangle<float>& bounds)
622618
623619 for (const auto & signal : signals)
624620 {
625- if (!signal.visible || signal.name .isEmpty ())
621+ if (! signal.visible || signal.name .isEmpty ())
626622 continue ;
627623
628624 // Draw color indicator
@@ -635,8 +631,7 @@ void CartesianPlane::drawLegend (Graphics& g, const Rectangle<float>& bounds)
635631 static_cast <int > (legendX + padding + 18 ),
636632 static_cast <int > (itemY),
637633 legendWidth - padding - 18 - padding,
638- itemHeight
639- );
634+ itemHeight);
640635
641636 g.setFillColor (Colors::white);
642637 g.fillFittedText (signal.name , font, textBounds, Justification::centerLeft);
@@ -668,25 +663,25 @@ String CartesianPlane::formatAxisValue (double value, AxisScaleType scaleType) c
668663std::optional<Point<float >> CartesianPlane::findBoundsIntersection (const Point<float >& p1, const Point<float >& p2, const Rectangle<float >& bounds) const
669664{
670665 // Find intersection of line segment p1-p2 with rectangle bounds
671-
666+
672667 float dx = p2.getX () - p1.getX ();
673668 float dy = p2.getY () - p1.getY ();
674-
669+
675670 if (std::abs (dx) < 1e-6f && std::abs (dy) < 1e-6f )
676671 return std::nullopt ; // Points are the same
677-
672+
678673 float t_min = 0 .0f ;
679674 float t_max = 1 .0f ;
680-
675+
681676 // Check intersection with vertical bounds (left and right edges)
682677 if (std::abs (dx) > 1e-6f )
683678 {
684679 float t_left = (bounds.getX () - p1.getX ()) / dx;
685680 float t_right = (bounds.getRight () - p1.getX ()) / dx;
686-
681+
687682 float t_min_x = jmin (t_left, t_right);
688683 float t_max_x = jmax (t_left, t_right);
689-
684+
690685 t_min = jmax (t_min, t_min_x);
691686 t_max = jmin (t_max, t_max_x);
692687 }
@@ -696,16 +691,16 @@ std::optional<Point<float>> CartesianPlane::findBoundsIntersection (const Point<
696691 if (p1.getX () < bounds.getX () || p1.getX () > bounds.getRight ())
697692 return std::nullopt ;
698693 }
699-
694+
700695 // Check intersection with horizontal bounds (top and bottom edges)
701696 if (std::abs (dy) > 1e-6f )
702697 {
703698 float t_top = (bounds.getY () - p1.getY ()) / dy;
704699 float t_bottom = (bounds.getBottom () - p1.getY ()) / dy;
705-
700+
706701 float t_min_y = jmin (t_top, t_bottom);
707702 float t_max_y = jmax (t_top, t_bottom);
708-
703+
709704 t_min = jmax (t_min, t_min_y);
710705 t_max = jmin (t_max, t_max_y);
711706 }
@@ -715,10 +710,10 @@ std::optional<Point<float>> CartesianPlane::findBoundsIntersection (const Point<
715710 if (p1.getY () < bounds.getY () || p1.getY () > bounds.getBottom ())
716711 return std::nullopt ;
717712 }
718-
713+
719714 if (t_min <= t_max && t_min >= 0 .0f && t_min <= 1 .0f )
720715 return Point<float > (p1.getX () + t_min * dx, p1.getY () + t_min * dy);
721-
716+
722717 return std::nullopt ;
723718}
724719
0 commit comments