fix path_move_dx

This commit is contained in:
artemp 2014-07-17 17:26:20 +01:00
parent 620aa62ab5
commit 18d1d0b8d5
2 changed files with 5 additions and 2 deletions

View file

@ -97,6 +97,7 @@ private:
box2d<double> marker_box_; box2d<double> marker_box_;
bool marker_unlocked_; bool marker_unlocked_;
pixel_position marker_displacement_; pixel_position marker_displacement_;
double move_dx_ = 0.0;
}; };
}//ns mapnik }//ns mapnik

View file

@ -67,6 +67,7 @@ bool placement_finder::next_position()
{ {
text_layout_ptr layout = std::make_shared<text_layout>(font_manager_, scale_factor_, info_.properties.layout_defaults); text_layout_ptr layout = std::make_shared<text_layout>(font_manager_, scale_factor_, info_.properties.layout_defaults);
layout->evaluate_properties(feature_, attr_); layout->evaluate_properties(feature_, attr_);
move_dx_ = layout->displacement().x;
info_.properties.process(*layout, feature_, attr_); info_.properties.process(*layout, feature_, attr_);
layouts_.clear(); // FIXME !!!! layouts_.clear(); // FIXME !!!!
layouts_.add(layout); layouts_.add(layout);
@ -213,8 +214,9 @@ bool placement_finder::find_line_placements(T & path, bool points)
{ {
pp.forward(pp.length()); pp.forward(pp.length());
} }
double dx = layouts_.back()->displacement().x;
if (dx != 0.0) path_move_dx(pp, dx); if (move_dx_ != 0.0) path_move_dx(pp, move_dx_);
do do
{ {
tolerance_iterator tolerance_offset(info_.properties.label_position_tolerance * scale_factor_, spacing); //TODO: Handle halign tolerance_iterator tolerance_offset(info_.properties.label_position_tolerance * scale_factor_, spacing); //TODO: Handle halign