diff --git a/deps/agg/include/agg_color_gray.h b/deps/agg/include/agg_color_gray.h index 2fc01bd71..f2cd0ff9c 100644 --- a/deps/agg/include/agg_color_gray.h +++ b/deps/agg/include/agg_color_gray.h @@ -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; } diff --git a/deps/agg/include/agg_color_rgba.h b/deps/agg/include/agg_color_rgba.h index 2950467e4..b4e3f76d8 100644 --- a/deps/agg/include/agg_color_rgba.h +++ b/deps/agg/include/agg_color_rgba.h @@ -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; } diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index d3c2622a9..b67d648ac 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -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(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 diff --git a/test/data-visual b/test/data-visual index ea6aa0ed3..7fd9b1954 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit ea6aa0ed3c54a079f3cd761237d3f986e39ee876 +Subproject commit 7fd9b1954e87105c69bb0670db486147e2284ff5