diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-04-01 17:00:00 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-04-01 17:00:00 +0000 |
| commit | 208ccdf9782984702f79b8ba416e67dd1e2c2dfa (patch) | |
| tree | 79d15123aa526c49c6386db6245fbfc6b7a63eaf /src/line-geometry.cpp | |
| parent | update to trunk (diff) | |
| parent | partial 2geom update: (diff) | |
| download | inkscape-208ccdf9782984702f79b8ba416e67dd1e2c2dfa.tar.gz inkscape-208ccdf9782984702f79b8ba416e67dd1e2c2dfa.zip | |
update to trunk
(bzr r12588.1.32)
Diffstat (limited to 'src/line-geometry.cpp')
| -rw-r--r-- | src/line-geometry.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/line-geometry.cpp b/src/line-geometry.cpp index e9f07f96f..566af8840 100644 --- a/src/line-geometry.cpp +++ b/src/line-geometry.cpp @@ -28,8 +28,9 @@ namespace Box3D { * of the segment. Otherwise interpret it as the direction of the line. * FIXME: Think of a better way to distinguish between the two constructors of lines. */ -Line::Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint) { - pt = start; +Line::Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint): + pt(start) +{ if (is_endpoint) v_dir = vec - start; else @@ -38,11 +39,12 @@ Line::Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint) { d0 = Geom::dot(normal, pt); } -Line::Line(Line const &line) { - pt = line.pt; - v_dir = line.v_dir; - normal = line.normal; - d0 = line.d0; +Line::Line(Line const &line): + pt(line.pt), + v_dir(line.v_dir), + normal(line.normal), + d0(line.d0) +{ } Line &Line::operator=(Line const &line) { @@ -116,7 +118,7 @@ bool lies_in_sector (Geom::Point const &v1, Geom::Point const &v2, Geom::Point c // FIXME: Can we assume that it's safe to return true if the vectors point in different directions? return (Geom::dot (v1, v2) < 0); } - return (coords.first >= 0 and coords.second >= 0); + return (coords.first >= 0 && coords.second >= 0); } bool lies_in_quadrangle (Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D, Geom::Point const &pt) |
