Partially fix 1823082. It works OK for polygon, region, outline and star now. Plant...
[synfig.git] / synfig-core / trunk / src / synfig / layer_shape.cpp
index d1e7aef..a686bcf 100644 (file)
@@ -713,7 +713,7 @@ struct Layer_Shape::Intersector
 {
        Rect    aabb;
 
-       //! true iff aabb hasn't been initialised yet
+       //! true iff aabb hasn't been initialized yet
        bool    initaabb;
 
        int     flags;
@@ -1548,7 +1548,7 @@ void Layer_Shape::PolySpan::conic_to(Real x1, Real y1, Real x, Real y)
        {
                if(num >= MAX_SUBDIVISION_SIZE)
                {
-                       warning("Curve subdivision somehow ran out of space while tesselating!");
+                       warning("Curve subdivision somehow ran out of space while tessellating!");
 
                        //do something...
                        assert(0);
@@ -1621,7 +1621,7 @@ void Layer_Shape::PolySpan::cubic_to(Real x1, Real y1, Real x2, Real y2, Real x,
        {
                if(num >= MAX_SUBDIVISION_SIZE)
                {
-                       warning("Curve subdivision somehow ran out of space while tesselating!");
+                       warning("Curve subdivision somehow ran out of space while tessellating!");
 
                        //do something...
                        assert(0);
@@ -1699,7 +1699,7 @@ void Layer_Shape::PolySpan::draw_scanline(int y, Real x1, Real fy1, Real x2, Rea
        //case all in same pixel
        if(ix1 == ix2)  //impossible for degenerate case (covered by the previous cases)
        {
-               current.addcover(dy,(fx1 + fx2)*dy/2); //horizontal trapazoid area
+               current.addcover(dy,(fx1 + fx2)*dy/2); //horizontal trapezoid area
                return;
        }
 
@@ -1713,7 +1713,7 @@ void Layer_Shape::PolySpan::draw_scanline(int y, Real x1, Real fy1, Real x2, Rea
                mult = (1 - fx1)*dydx;  //next y intersection diff value (at 1)
 
                //first pixel
-               current.addcover(mult,(1 + fx1)*mult/2);        // fx1,fy1,1,fy@1 - starting trapazoidal area
+               current.addcover(mult,(1 + fx1)*mult/2);        // fx1,fy1,1,fy@1 - starting trapezoidal area
 
                //move to the next pixel
                fy1 += mult;
@@ -1749,7 +1749,7 @@ void Layer_Shape::PolySpan::draw_scanline(int y, Real x1, Real fy1, Real x2, Rea
                mult = fx1*dydx;        //next y intersection diff value
 
                //first pixel
-               current.addcover(mult,fx1*mult/2);      // fx1,fy1,0,fy@0 - starting trapazoidal area
+               current.addcover(mult,fx1*mult/2);      // fx1,fy1,0,fy@0 - starting trapezoidal area
 
                //move to next pixel
                fy1 += mult;
@@ -1877,7 +1877,7 @@ void Layer_Shape::PolySpan::draw_line(Real x1, Real y1, Real x2, Real y2)
 
                mult = (1 - fy1) * dxdy;
 
-               //x interset scanline
+               //x intersect scanline
                x_from = x1 + mult;
                draw_scanline(iy1,x1,fy1,x_from,1);
 
@@ -1907,7 +1907,7 @@ void Layer_Shape::PolySpan::draw_line(Real x1, Real y1, Real x2, Real y2)
 
                mult = fy1 * dxdy;
 
-               //x interset scanline
+               //x intersect scanline
                x_from = x1 + mult;
                draw_scanline(iy1,x1,fy1,x_from,0);
 
@@ -2640,7 +2640,11 @@ Layer_Shape::render_shape(Surface *surface,bool useblend,int /*quality*/,
 
        PolySpan        span;
 
-       //optimization for tesselating only inside tiles
+       // if the pixels are zero sized then we're too zoomed out to see anything
+       if (pw == 0 || ph == 0)
+               return true;
+
+       //optimization for tessellating only inside tiles
        span.window.minx = 0;
        span.window.miny = 0;
        span.window.maxx = w;
@@ -2876,7 +2880,7 @@ Layer_Shape::render_shape(surface<float> *surface,int /*quality*/,
 
        PolySpan        span;
 
-       //optimization for tesselating only inside tiles
+       //optimization for tessellating only inside tiles
        span.window.minx = 0;
        span.window.miny = 0;
        span.window.maxx = w;