diff --git a/agg/include/agg_scanline_boolean_algebra.h b/agg/include/agg_scanline_boolean_algebra.h index ad359e61b..bc2e9c9d5 100644 --- a/agg/include/agg_scanline_boolean_algebra.h +++ b/agg/include/agg_scanline_boolean_algebra.h @@ -850,8 +850,8 @@ namespace agg unsigned num1 = sl1.num_spans(); unsigned num2 = sl2.num_spans(); - typename Scanline1::const_iterator span1; - typename Scanline2::const_iterator span2; + typename Scanline1::const_iterator span1;// = sl1.begin(); + typename Scanline2::const_iterator span2;// = sl2.begin(); enum invalidation_e { @@ -1046,7 +1046,11 @@ namespace agg // Calculate the union of the bounding boxes //----------------- - rect_i ur = unite_rectangles(r1, r2); + rect_i ur(1,1,0,0); + if(flag1 && flag2) ur = unite_rectangles(r1, r2); + else if(flag1) ur = r1; + else if(flag2) ur = r2; + if(!ur.is_valid()) return; ren.prepare(); @@ -1176,7 +1180,7 @@ namespace agg ren.prepare(); // A fake span2 processor - sbool_add_span_empty add_span2; + sbool_add_span_empty add_span2; // The main loop // Here we synchronize the scanlines with diff --git a/agg/include/agg_scanline_storage_aa.h b/agg/include/agg_scanline_storage_aa.h index 4ea187e35..033e3291e 100644 --- a/agg/include/agg_scanline_storage_aa.h +++ b/agg/include/agg_scanline_storage_aa.h @@ -196,6 +196,7 @@ namespace agg const T* covers; }; + const_iterator() : m_storage(0) {} const_iterator(const embedded_scanline& sl) : m_storage(sl.m_storage), m_span_idx(sl.m_scanline.start_span) @@ -554,6 +555,7 @@ namespace agg const T* covers; }; + const_iterator() : m_ptr(0) {} const_iterator(const embedded_scanline& sl) : m_ptr(sl.m_ptr), m_dx(sl.m_dx) @@ -721,9 +723,8 @@ namespace agg m_min_y = read_int32() + m_dy; m_max_x = read_int32() + m_dx; m_max_y = read_int32() + m_dy; - return true; } - return false; + return m_ptr < m_end; } //-------------------------------------------------------------------- diff --git a/agg/include/agg_scanline_storage_bin.h b/agg/include/agg_scanline_storage_bin.h index 07ea2ee36..d76001697 100644 --- a/agg/include/agg_scanline_storage_bin.h +++ b/agg/include/agg_scanline_storage_bin.h @@ -63,6 +63,7 @@ namespace agg class const_iterator { public: + const_iterator() : m_storage(0) {} const_iterator(const embedded_scanline& sl) : m_storage(sl.m_storage), m_span_idx(sl.m_scanline.start_span) @@ -360,6 +361,7 @@ namespace agg int32 len; }; + const_iterator() : m_ptr(0) {} const_iterator(const embedded_scanline& sl) : m_ptr(sl.m_ptr), m_dx(sl.m_dx) @@ -503,9 +505,8 @@ namespace agg m_min_y = read_int32() + m_dy; m_max_x = read_int32() + m_dx; m_max_y = read_int32() + m_dy; - return true; } - return false; + return m_ptr < m_end; } //-------------------------------------------------------------------- diff --git a/agg/include/agg_span_image_filter_gray.h b/agg/include/agg_span_image_filter_gray.h index bdc30e342..002234498 100644 --- a/agg/include/agg_span_image_filter_gray.h +++ b/agg/include/agg_span_image_filter_gray.h @@ -123,7 +123,6 @@ namespace agg int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; - unsigned weight; fg = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; @@ -139,7 +138,7 @@ namespace agg fg += *fg_ptr * (image_subpixel_scale - x_hr) * y_hr; fg_ptr = (const value_type*)base_type::source().next_x(); - fg += fg_ptr * x_hr * y_hr; + fg += *fg_ptr * x_hr * y_hr; span->v = value_type(fg >> (image_subpixel_shift * 2)); span->a = base_mask; diff --git a/agg/src/agg_curves.cpp b/agg/src/agg_curves.cpp index 5cdf65eff..ae8cb5b9e 100644 --- a/agg/src/agg_curves.cpp +++ b/agg/src/agg_curves.cpp @@ -262,9 +262,9 @@ namespace agg double dx3 = x4 - x3; double dy3 = y4 - y3; - double len = sqrt(dx1 * dx1 + dy1 * dy1) + - sqrt(dx2 * dx2 + dy2 * dy2) + - sqrt(dx3 * dx3 + dy3 * dy3) * 0.25 * m_scale; + double len = (sqrt(dx1 * dx1 + dy1 * dy1) + + sqrt(dx2 * dx2 + dy2 * dy2) + + sqrt(dx3 * dx3 + dy3 * dy3)) * 0.25 * m_scale; #if defined(_MSC_VER) && _MSC_VER <= 1200 m_num_steps = uround(MSC60_fix_ICE(len));