Use middle_point placement for marker POINT placement on lines
REFS #1604, #1350, #1607 and #1625
This commit is contained in:
parent
93f58b1ef3
commit
3e938cbfaa
7 changed files with 24 additions and 2 deletions
2
deps/agg/include/agg_conv_adaptor_vcgen.h
vendored
2
deps/agg/include/agg_conv_adaptor_vcgen.h
vendored
|
@ -29,6 +29,7 @@ namespace agg
|
||||||
|
|
||||||
void rewind(unsigned) {}
|
void rewind(unsigned) {}
|
||||||
unsigned vertex(double*, double*) { return path_cmd_stop; }
|
unsigned vertex(double*, double*) { return path_cmd_stop; }
|
||||||
|
unsigned type() const { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +65,7 @@ namespace agg
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned vertex(double* x, double* y);
|
unsigned vertex(double* x, double* y);
|
||||||
|
unsigned type() const { return m_source->type(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Prohibit copying
|
// Prohibit copying
|
||||||
|
|
1
deps/agg/include/agg_conv_adaptor_vpgen.h
vendored
1
deps/agg/include/agg_conv_adaptor_vpgen.h
vendored
|
@ -33,6 +33,7 @@ namespace agg
|
||||||
|
|
||||||
void rewind(unsigned path_id);
|
void rewind(unsigned path_id);
|
||||||
unsigned vertex(double* x, double* y);
|
unsigned vertex(double* x, double* y);
|
||||||
|
unsigned type() const { return m_source->type(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
conv_adaptor_vpgen(const conv_adaptor_vpgen<VertexSource, VPGen>&);
|
conv_adaptor_vpgen(const conv_adaptor_vpgen<VertexSource, VPGen>&);
|
||||||
|
|
1
deps/agg/include/agg_conv_clip_polygon.h
vendored
1
deps/agg/include/agg_conv_clip_polygon.h
vendored
|
@ -51,6 +51,7 @@ namespace agg
|
||||||
double y1() const { return base_type::vpgen().y1(); }
|
double y1() const { return base_type::vpgen().y1(); }
|
||||||
double x2() const { return base_type::vpgen().x2(); }
|
double x2() const { return base_type::vpgen().x2(); }
|
||||||
double y2() const { return base_type::vpgen().y2(); }
|
double y2() const { return base_type::vpgen().y2(); }
|
||||||
|
unsigned type() const { return base_type::type(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
conv_clip_polygon(const conv_clip_polygon<VertexSource>&);
|
conv_clip_polygon(const conv_clip_polygon<VertexSource>&);
|
||||||
|
|
1
deps/agg/include/agg_conv_clip_polyline.h
vendored
1
deps/agg/include/agg_conv_clip_polyline.h
vendored
|
@ -51,6 +51,7 @@ namespace agg
|
||||||
double y1() const { return base_type::vpgen().y1(); }
|
double y1() const { return base_type::vpgen().y1(); }
|
||||||
double x2() const { return base_type::vpgen().x2(); }
|
double x2() const { return base_type::vpgen().x2(); }
|
||||||
double y2() const { return base_type::vpgen().y2(); }
|
double y2() const { return base_type::vpgen().y2(); }
|
||||||
|
unsigned type() const { return base_type::type(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
conv_clip_polyline(const conv_clip_polyline<VertexSource>&);
|
conv_clip_polyline(const conv_clip_polyline<VertexSource>&);
|
||||||
|
|
2
deps/agg/include/agg_conv_smooth_poly1.h
vendored
2
deps/agg/include/agg_conv_smooth_poly1.h
vendored
|
@ -42,6 +42,7 @@ namespace agg
|
||||||
|
|
||||||
void smooth_value(double v) { base_type::generator().smooth_value(v); }
|
void smooth_value(double v) { base_type::generator().smooth_value(v); }
|
||||||
double smooth_value() const { return base_type::generator().smooth_value(); }
|
double smooth_value() const { return base_type::generator().smooth_value(); }
|
||||||
|
unsigned type() const { return base_type::type(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
conv_smooth_poly1(const conv_smooth_poly1<VertexSource>&);
|
conv_smooth_poly1(const conv_smooth_poly1<VertexSource>&);
|
||||||
|
@ -64,6 +65,7 @@ namespace agg
|
||||||
|
|
||||||
void smooth_value(double v) { m_smooth.generator().smooth_value(v); }
|
void smooth_value(double v) { m_smooth.generator().smooth_value(v); }
|
||||||
double smooth_value() const { return m_smooth.generator().smooth_value(); }
|
double smooth_value() const { return m_smooth.generator().smooth_value(); }
|
||||||
|
unsigned type() const { return m_smooth.type(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
conv_smooth_poly1_curve(const conv_smooth_poly1_curve<VertexSource>&);
|
conv_smooth_poly1_curve(const conv_smooth_poly1_curve<VertexSource>&);
|
||||||
|
|
|
@ -81,6 +81,11 @@ struct MAPNIK_DECL coord_transform
|
||||||
geom_.rewind(pos);
|
geom_.rewind(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned type() const
|
||||||
|
{
|
||||||
|
return static_cast<unsigned>(geom_.type());
|
||||||
|
}
|
||||||
|
|
||||||
Geometry const& geom() const
|
Geometry const& geom() const
|
||||||
{
|
{
|
||||||
return geom_;
|
return geom_;
|
||||||
|
|
|
@ -91,7 +91,12 @@ struct vector_markers_rasterizer_dispatch
|
||||||
{
|
{
|
||||||
double x = 0;
|
double x = 0;
|
||||||
double y = 0;
|
double y = 0;
|
||||||
if (placement_method == MARKER_INTERIOR_PLACEMENT)
|
if (path.type() == LineString)
|
||||||
|
{
|
||||||
|
if (!label::middle_point(path, x, y))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (placement_method == MARKER_INTERIOR_PLACEMENT)
|
||||||
{
|
{
|
||||||
if (!label::interior_position(path, x, y))
|
if (!label::interior_position(path, x, y))
|
||||||
return;
|
return;
|
||||||
|
@ -187,7 +192,12 @@ struct raster_markers_rasterizer_dispatch
|
||||||
{
|
{
|
||||||
double x = 0;
|
double x = 0;
|
||||||
double y = 0;
|
double y = 0;
|
||||||
if (placement_method == MARKER_INTERIOR_PLACEMENT)
|
if (path.type() == LineString)
|
||||||
|
{
|
||||||
|
if (!label::middle_point(path, x, y))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (placement_method == MARKER_INTERIOR_PLACEMENT)
|
||||||
{
|
{
|
||||||
if (!label::interior_position(path, x, y))
|
if (!label::interior_position(path, x, y))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue