diff --git a/include/mapnik/text/glyph_positions.hpp b/include/mapnik/text/glyph_positions.hpp index 9e03c3f1e..2db077b18 100644 --- a/include/mapnik/text/glyph_positions.hpp +++ b/include/mapnik/text/glyph_positions.hpp @@ -72,7 +72,7 @@ public: const_iterator begin() const; const_iterator end() const; - void push_back(glyph_info const& glyph, pixel_position offset, rotation const& rot); + void emplace_back(glyph_info const& glyph, pixel_position offset, rotation const& rot); void reserve(unsigned count); pixel_position const& get_base_point() const; diff --git a/src/renderer_common/process_group_symbolizer.cpp b/src/renderer_common/process_group_symbolizer.cpp index 082f0de53..27022f4fb 100644 --- a/src/renderer_common/process_group_symbolizer.cpp +++ b/src/renderer_common/process_group_symbolizer.cpp @@ -65,7 +65,7 @@ text_render_thunk::text_render_thunk(placements_list const& placements, for (glyph_position const& pos : *positions) { glyph_vec.push_back(pos.glyph); - new_pos.push_back(glyph_vec.back(), pos.pos, pos.rot); + new_pos.emplace_back(glyph_vec.back(), pos.pos, pos.rot); } placements_.push_back(new_positions); diff --git a/src/text/glyph_positions.cpp b/src/text/glyph_positions.cpp index c5d357f15..1f42ec69e 100644 --- a/src/text/glyph_positions.cpp +++ b/src/text/glyph_positions.cpp @@ -48,9 +48,9 @@ glyph_positions::const_iterator glyph_positions::end() const return data_.end(); } -void glyph_positions::push_back(glyph_info const& glyph, pixel_position offset, rotation const& rot) +void glyph_positions::emplace_back(glyph_info const& glyph, pixel_position offset, rotation const& rot) { - data_.push_back(glyph_position(glyph, offset, rot)); + data_.emplace_back(glyph, offset, rot); } void glyph_positions::reserve(unsigned count) diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index b473f1343..3cb60ad7f 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -154,7 +154,7 @@ bool placement_finder::find_point_placement(pixel_position const& pos) for (auto const& glyph : line) { // place the character relative to the center of the string envelope - glyphs->push_back(glyph, (pixel_position(x, y).rotate(orientation)) + layout_offset, orientation); + glyphs->emplace_back(glyph, (pixel_position(x, y).rotate(orientation)) + layout_offset, orientation); if (glyph.advance()) { //Only advance if glyph is not part of a multiple glyph sequence @@ -252,7 +252,7 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or box2d bbox = get_bbox(layout, glyph, pos, rot); if (collision(bbox, layouts_.text(), true)) return false; bboxes.push_back(std::move(bbox)); - glyphs->push_back(glyph, pos, rot); + glyphs->emplace_back(glyph, pos, rot); } // See comment above offset -= sign * line.height()/2;