mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
fix issues reported by scan-build - closes #2813
This commit is contained in:
parent
53be585240
commit
956de13d4e
4
deps/agg/include/agg_color_gray.h
vendored
4
deps/agg/include/agg_color_gray.h
vendored
@ -330,8 +330,8 @@ struct gray8T
|
||||
//--------------------------------------------------------------------
|
||||
self_type& opacity(double a_)
|
||||
{
|
||||
if (a_ < 0) a_ = 0;
|
||||
else if (a_ > 1) a_ = 1;
|
||||
if (a_ < 0) a = 0;
|
||||
else if (a_ > 1) a = 1;
|
||||
else a = (value_type)uround(a_ * double(base_mask));
|
||||
return *this;
|
||||
}
|
||||
|
||||
16
deps/agg/include/agg_color_rgba.h
vendored
16
deps/agg/include/agg_color_rgba.h
vendored
@ -80,8 +80,8 @@ struct rgba
|
||||
//--------------------------------------------------------------------
|
||||
rgba& opacity(double a_)
|
||||
{
|
||||
if (a_ < 0) a_ = 0;
|
||||
else if (a_ > 1) a_ = 1;
|
||||
if (a_ < 0) a = 0;
|
||||
else if (a_ > 1) a = 1;
|
||||
else a = a_;
|
||||
return *this;
|
||||
}
|
||||
@ -472,8 +472,8 @@ struct rgba8T
|
||||
//--------------------------------------------------------------------
|
||||
self_type& opacity(double a_)
|
||||
{
|
||||
if (a_ < 0) a_ = 0;
|
||||
else if (a_ > 1) a_ = 1;
|
||||
if (a_ < 0) a = 0;
|
||||
else if (a_ > 1) a = 1;
|
||||
else a = (value_type)uround(a_ * double(base_mask));
|
||||
return *this;
|
||||
}
|
||||
@ -882,8 +882,8 @@ struct rgba16
|
||||
//--------------------------------------------------------------------
|
||||
AGG_INLINE self_type& opacity(double a_)
|
||||
{
|
||||
if (a_ < 0) a_ = 0;
|
||||
if (a_ > 1) a_ = 1;
|
||||
if (a_ < 0) a = 0;
|
||||
if (a_ > 1) a = 1;
|
||||
a = value_type(uround(a_ * double(base_mask)));
|
||||
return *this;
|
||||
}
|
||||
@ -1238,8 +1238,8 @@ struct rgba32
|
||||
//--------------------------------------------------------------------
|
||||
AGG_INLINE self_type& opacity(double a_)
|
||||
{
|
||||
if (a_ < 0) a_ = 0;
|
||||
else if (a_ > 1) a_ = 1;
|
||||
if (a_ < 0) a = 0;
|
||||
else if (a_ > 1) a = 1;
|
||||
else a = value_type(a_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -239,10 +239,9 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or
|
||||
double last_cluster_angle = 999;
|
||||
int current_cluster = -1;
|
||||
pixel_position cluster_offset;
|
||||
double angle;
|
||||
double angle = 0;
|
||||
rotation rot;
|
||||
double last_glyph_spacing = 0.;
|
||||
|
||||
double last_glyph_spacing = 0.0;
|
||||
for (auto const& glyph : line)
|
||||
{
|
||||
if (current_cluster != static_cast<int>(glyph.char_index))
|
||||
@ -250,13 +249,17 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or
|
||||
if (adjust)
|
||||
{
|
||||
if (!off_pp.move(sign * (layout.cluster_width(current_cluster) + last_glyph_spacing)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
last_glyph_spacing = adjust_character_spacing;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!off_pp.move_to_distance(sign * (layout.cluster_width(current_cluster) + last_glyph_spacing)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
last_glyph_spacing = glyph.format->character_spacing * scale_factor_;
|
||||
}
|
||||
current_cluster = glyph.char_index;
|
||||
@ -274,7 +277,10 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or
|
||||
last_cluster_angle = angle;
|
||||
}
|
||||
|
||||
if (std::abs(angle) > M_PI/2) ++upside_down_glyph_count;
|
||||
if (std::abs(angle) > M_PI/2)
|
||||
{
|
||||
++upside_down_glyph_count;
|
||||
}
|
||||
|
||||
pixel_position pos = off_pp.current_position() + cluster_offset;
|
||||
// Center the text on the line
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit ea6aa0ed3c54a079f3cd761237d3f986e39ee876
|
||||
Subproject commit 7fd9b1954e87105c69bb0670db486147e2284ff5
|
||||
Loading…
x
Reference in New Issue
Block a user