Permalink
Browse files

+ pass box2d<double> by const ref

+ make member const& too
  • Loading branch information...
1 parent 587f013 commit c8cfde58f7de36cf9dd5ab3e5b3da689ecfe9aab @artemp artemp committed Jul 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 include/mapnik/markers_placement.hpp
@@ -47,7 +47,7 @@ class markers_placement : boost::noncopyable
* converted to a positive value with similar magnitude, but
* choosen to optimize marker placement. 0 = no markers
*/
- markers_placement(Locator &locator, box2d<double> size, agg::trans_affine const& tr, Detector &detector, double spacing, double max_error, bool allow_overlap);
+ markers_placement(Locator &locator, box2d<double> const& size, agg::trans_affine const& tr, Detector &detector, double spacing, double max_error, bool allow_overlap);
/** Start again at first marker.
* \note Returns the same list of markers only works when they were NOT added
* to the detector.
@@ -64,7 +64,7 @@ class markers_placement : boost::noncopyable
bool get_point(double & x, double & y, double & angle, bool add_to_detector = true);
private:
Locator &locator_;
- box2d<double> size_;
+ box2d<double> const& size_;
agg::trans_affine tr_;
Detector &detector_;
double spacing_;

2 comments on commit c8cfde5

Contributor

lightmare replied Jul 19, 2012

Passing is ok, but I'd still keep a copy inside. Consider markers_placement(loc, box*2, tr*trans_affine_scaling(2), ...). It's a bit unexpected that tr_ is copied while size_ isn't.

Owner

artemp replied Jul 19, 2012

@lightmare - yep, good call
fixed in e0c2304

Please sign in to comment.