use 'avoid_edges' parameter for point placement

This commit is contained in:
Artem Pavlenko 2007-11-06 09:07:18 +00:00
parent 01de9d9e8c
commit 6eadaafd49

View file

@ -355,11 +355,14 @@ namespace mapnik
current_placement->starting_y - y - ci.height); current_placement->starting_y - y - ci.height);
} }
if (!dimensions_.intersects(e) || !detector_.has_placement(e, p.info.get_string(), p.minimum_distance)) if (!dimensions_.intersects(e) ||
!detector_.has_placement(e, p.info.get_string(), p.minimum_distance))
{ {
return ; return;
} }
if (p.avoid_edges && !dimensions_.contains(e)) return;
p.envelopes.push(e); p.envelopes.push(e);
} }
x += ci.width; x += ci.width;
@ -462,7 +465,8 @@ namespace mapnik
angle_delta -= 2*M_PI; angle_delta -= 2*M_PI;
while (angle_delta < -M_PI) while (angle_delta < -M_PI)
angle_delta += 2*M_PI; angle_delta += 2*M_PI;
if (p.max_char_angle_delta > 0 && fabs(angle_delta) > p.max_char_angle_delta*(M_PI/180)) if (p.max_char_angle_delta > 0 &&
fabs(angle_delta) > p.max_char_angle_delta*(M_PI/180))
{ {
status = false; status = false;
} }
@ -569,7 +573,9 @@ namespace mapnik
template <typename DetectorT> template <typename DetectorT>
template <typename PathT> template <typename PathT>
bool placement_finder<DetectorT>::build_path_follow(placement & p, double target_distance, PathT & shape_path) bool placement_finder<DetectorT>::build_path_follow(placement & p,
double target_distance,
PathT & shape_path)
{ {
double new_x = 0.0; double new_x = 0.0;
double new_y = 0.0; double new_y = 0.0;