NO-OP: whitespace
This commit is contained in:
parent
9bbedcb781
commit
bc4de874dc
@ -21,8 +21,8 @@
|
||||
|
||||
#include "pbd/compose.h"
|
||||
|
||||
#include "canvas/poly_item.h"
|
||||
#include "canvas/canvas.h"
|
||||
#include "canvas/poly_item.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ArdourCanvas;
|
||||
@ -40,18 +40,16 @@ PolyItem::PolyItem (Item* parent)
|
||||
void
|
||||
PolyItem::compute_bounding_box () const
|
||||
{
|
||||
|
||||
if (!_points.empty()) {
|
||||
|
||||
if (!_points.empty ()) {
|
||||
Rect bbox;
|
||||
Points::const_iterator i = _points.begin();
|
||||
Points::const_iterator i = _points.begin ();
|
||||
|
||||
bbox.x0 = bbox.x1 = i->x;
|
||||
bbox.y0 = bbox.y1 = i->y;
|
||||
|
||||
++i;
|
||||
|
||||
while (i != _points.end()) {
|
||||
while (i != _points.end ()) {
|
||||
bbox.x0 = min (bbox.x0, i->x);
|
||||
bbox.y0 = min (bbox.y0, i->y);
|
||||
bbox.x1 = max (bbox.x1, i->x);
|
||||
@ -61,7 +59,6 @@ PolyItem::compute_bounding_box () const
|
||||
|
||||
_bounding_box = bbox.expand (_outline_width + 0.5);
|
||||
|
||||
|
||||
} else {
|
||||
_bounding_box = Rect ();
|
||||
}
|
||||
@ -70,24 +67,25 @@ PolyItem::compute_bounding_box () const
|
||||
}
|
||||
|
||||
void
|
||||
PolyItem::render_path (Rect const & /* area */, Cairo::RefPtr<Cairo::Context> context) const
|
||||
PolyItem::render_path (Rect const& /* area */, Cairo::RefPtr<Cairo::Context> context) const
|
||||
{
|
||||
if (_points.size() < 2) {
|
||||
if (_points.size () < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
Points::const_iterator i = _points.begin();
|
||||
Duple c0 (item_to_window (Duple (i->x, i->y)));
|
||||
const double pixel_adjust = (_outline_width == 1.0 ? 0.5 : 0.0);
|
||||
|
||||
Points::const_iterator i = _points.begin ();
|
||||
Duple c0 = item_to_window (Duple (i->x, i->y));
|
||||
|
||||
++i;
|
||||
|
||||
while (c0.x < -1.) {
|
||||
Duple c1 (item_to_window (Duple (i->x, i->y)));
|
||||
if (interpolate_line(c0, c1, -1)) {
|
||||
if (interpolate_line (c0, c1, -1)) {
|
||||
break;
|
||||
}
|
||||
if (++i == _points.end()) {
|
||||
if (++i == _points.end ()) {
|
||||
c1.x = 0;
|
||||
context->move_to (c1.x + pixel_adjust, c1.y + pixel_adjust);
|
||||
_left = _right = c1;
|
||||
@ -99,7 +97,7 @@ PolyItem::render_path (Rect const & /* area */, Cairo::RefPtr<Cairo::Context> co
|
||||
context->move_to (c0.x + pixel_adjust, c0.y + pixel_adjust);
|
||||
_left = c0;
|
||||
|
||||
while (i != _points.end()) {
|
||||
while (i != _points.end ()) {
|
||||
Duple c = item_to_window (Duple (i->x, i->y));
|
||||
if (c.x > 16383) {
|
||||
if (interpolate_line (c0, c, 16383)) {
|
||||
@ -130,10 +128,9 @@ PolyItem::interpolate_line (Duple& c0, Duple const& c1, Coord const x)
|
||||
}
|
||||
|
||||
void
|
||||
PolyItem::set (Points const & points)
|
||||
PolyItem::set (Points const& points)
|
||||
{
|
||||
if (_points != points) {
|
||||
|
||||
begin_change ();
|
||||
|
||||
_points = points;
|
||||
@ -143,7 +140,7 @@ PolyItem::set (Points const & points)
|
||||
}
|
||||
}
|
||||
|
||||
Points const &
|
||||
Points const&
|
||||
PolyItem::get () const
|
||||
{
|
||||
return _points;
|
||||
@ -154,8 +151,8 @@ PolyItem::dump (ostream& o) const
|
||||
{
|
||||
Item::dump (o);
|
||||
|
||||
o << _canvas->indent() << '\t' << _points.size() << " points" << endl;
|
||||
for (Points::const_iterator i = _points.begin(); i != _points.end(); ++i) {
|
||||
o << _canvas->indent() << "\t\t" << i->x << ", " << i->y << endl;
|
||||
o << _canvas->indent () << '\t' << _points.size () << " points" << endl;
|
||||
for (Points::const_iterator i = _points.begin (); i != _points.end (); ++i) {
|
||||
o << _canvas->indent () << "\t\t" << i->x << ", " << i->y << endl;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user