summaryrefslogtreecommitdiff
path: root/libs/canvas
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-04-10 18:32:18 +0200
committerRobin Gareus <robin@gareus.org>2020-04-10 18:32:18 +0200
commit247bd4d3d95230e7887d577d3bbdab8feb519b4d (patch)
tree61a45110ce458d24debccda193af83d8c07caba2 /libs/canvas
parentede0fd3ddf51766f70984e471588b435ef1cb431 (diff)
NO-OP: whitespace
Diffstat (limited to 'libs/canvas')
-rw-r--r--libs/canvas/poly_line.cc41
1 files changed, 20 insertions, 21 deletions
diff --git a/libs/canvas/poly_line.cc b/libs/canvas/poly_line.cc
index b1953ae4b8..a315f76174 100644
--- a/libs/canvas/poly_line.cc
+++ b/libs/canvas/poly_line.cc
@@ -20,8 +20,8 @@
#include <algorithm>
-#include "canvas/poly_line.h"
#include "canvas/canvas.h"
+#include "canvas/poly_line.h"
#include "canvas/utils.h"
using namespace ArdourCanvas;
@@ -54,18 +54,19 @@ PolyLine::compute_bounding_box () const
}
void
-PolyLine::set_fill_y1 (double y1) {
+PolyLine::set_fill_y1 (double y1)
+{
begin_change ();
_bounding_box_dirty = true;
- _y1 = y1;
+ _y1 = y1;
end_change ();
}
void
-PolyLine::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
+PolyLine::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) const
{
- if (_fill && _y1 > 0 && _points.size() > 0) {
- const ArdourCanvas::Rect& vp (_canvas->visible_area());
+ if (_fill && _y1 > 0 && _points.size () > 0) {
+ const ArdourCanvas::Rect& vp (_canvas->visible_area ());
setup_fill_context (context);
Duple y (0, _y1);
@@ -97,35 +98,35 @@ PolyLine::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
}
void
-PolyLine::set_steps (Points const & points, bool stepped)
+PolyLine::set_steps (Points const& points, bool stepped)
{
if (!stepped) {
- PolyItem::set(points);
+ PolyItem::set (points);
return;
}
Points copy;
- for (Points::const_iterator p = points.begin(); p != points.end();) {
+ for (Points::const_iterator p = points.begin (); p != points.end ();) {
Points::const_iterator next = p;
++next;
- copy.push_back(*p);
- if (next != points.end() && next->x != p->x) {
- copy.push_back(Duple(next->x, p->y));
+ copy.push_back (*p);
+ if (next != points.end () && next->x != p->x) {
+ copy.push_back (Duple (next->x, p->y));
}
p = next;
}
- PolyItem::set(copy);
+ PolyItem::set (copy);
}
bool
-PolyLine::covers (Duple const & point) const
+PolyLine::covers (Duple const& point) const
{
Duple p = window_to_item (point);
- const Points::size_type npoints = _points.size();
+ const Points::size_type npoints = _points.size ();
if (npoints < 2) {
return false;
@@ -136,14 +137,13 @@ PolyLine::covers (Duple const & point) const
/* repeat for each line segment */
- const Rect visible (window_to_item (_canvas->visible_area()));
+ const Rect visible (window_to_item (_canvas->visible_area ()));
for (i = 1, j = 0; i < npoints; ++i, ++j) {
-
- Duple at;
+ Duple at;
double t;
- Duple a (_points[j]);
- Duple b (_points[i]);
+ Duple a (_points[j]);
+ Duple b (_points[i]);
/*
Clamp the line endpoints to the visible area of the canvas. If we do
@@ -165,7 +165,6 @@ PolyLine::covers (Duple const & point) const
if (d < _threshold + _outline_width) {
return true;
}
-
}
return false;