+ pass by reference when possible (c++)
This commit is contained in:
parent
3b5707848e
commit
be61bf6fef
4 changed files with 9 additions and 9 deletions
|
@ -140,12 +140,12 @@ class text_path : mapnik::noncopyable
|
|||
|
||||
~character_node() {}
|
||||
|
||||
void vertex(char_info_ptr *c_, double *x_, double *y_, double *angle_) const
|
||||
void vertex(char_info_ptr & c_, double & x_, double & y_, double & angle_) const
|
||||
{
|
||||
*c_ = c;
|
||||
*x_ = pos.x;
|
||||
*y_ = pos.y;
|
||||
*angle_ = angle;
|
||||
c_ = c;
|
||||
x_ = pos.x;
|
||||
y_ = pos.y;
|
||||
angle_ = angle;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
}
|
||||
|
||||
/** Return node. Always returns a new node. Has no way to report that there are no more nodes. */
|
||||
void vertex(char_info_ptr *c, double *x, double *y, double *angle) const
|
||||
void vertex(char_info_ptr & c, double & x, double & y, double & angle) const
|
||||
{
|
||||
nodes_[itr_++].vertex(c, x, y, angle);
|
||||
}
|
||||
|
|
|
@ -417,7 +417,7 @@ void cairo_context::add_text(text_path const& path,
|
|||
char_info_ptr c;
|
||||
double x, y, angle;
|
||||
|
||||
path.vertex(&c, &x, &y, &angle);
|
||||
path.vertex(c, x, y, angle);
|
||||
|
||||
face_set_ptr faces = font_manager.get_face_set(c->format->face_name, c->format->fontset);
|
||||
double text_size = c->format->text_size * scale_factor;
|
||||
|
|
|
@ -357,7 +357,7 @@ box2d<double> text_renderer<T>::prepare_glyphs(text_path const& path)
|
|||
char_info_ptr c;
|
||||
double x, y, angle;
|
||||
|
||||
path.vertex(&c, &x, &y, &angle);
|
||||
path.vertex(c, x, y, angle);
|
||||
|
||||
// TODO Enable when we have support for setting verbosity
|
||||
// MAPNIK_LOG_DEBUG(font_engine_freetype) << "text_renderer: prepare_glyphs="
|
||||
|
|
|
@ -919,7 +919,7 @@ bool placement_finder<DetectorT>::test_placement(std::auto_ptr<text_path> const&
|
|||
double cwidth = ci.width + ci.format->character_spacing;
|
||||
char_info_ptr c;
|
||||
double x, y, angle;
|
||||
current_placement->vertex(&c, &x, &y, &angle);
|
||||
current_placement->vertex(c, x, y, angle);
|
||||
x = current_placement->center.x + x;
|
||||
y = current_placement->center.y - y;
|
||||
|
||||
|
|
Loading…
Reference in a new issue