gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/shape.cpp server/shape.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/shape.cpp server/shape.h
Date: Mon, 19 Feb 2007 10:41:57 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/19 10:41:57

Modified files:
        .              : ChangeLog 
        server         : shape.cpp shape.h 

Log message:
                * server/shape.{cpp,h}: new empty() and close()
                  methods.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2391&r2=1.2392
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.cpp?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.h?cvsroot=gnash&r1=1.18&r2=1.19

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2391
retrieving revision 1.2392
diff -u -b -r1.2391 -r1.2392
--- ChangeLog   18 Feb 2007 18:36:26 -0000      1.2391
+++ ChangeLog   19 Feb 2007 10:41:57 -0000      1.2392
@@ -1,3 +1,8 @@
+2007-02-19 Sandro Santilli <address@hidden>
+
+       * server/shape.{cpp,h}: new empty() and close()
+         methods.
+
 2007-02-18  Rob Savoye  <address@hidden>
 
        * plugin/klash/Makefile.am: Install klashpartui.rc,

Index: server/shape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/shape.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/shape.cpp    14 Feb 2007 12:48:18 -0000      1.28
+++ server/shape.cpp    19 Feb 2007 10:41:57 -0000      1.29
@@ -5,7 +5,7 @@
 
 // Quadratic bezier outline shapes, the basis for most SWF rendering.
 
-/* $Id: shape.cpp,v 1.28 2007/02/14 12:48:18 strk Exp $ */
+/* $Id: shape.cpp,v 1.29 2007/02/19 10:41:57 strk Exp $ */
 
 #include "shape.h"
 
@@ -295,6 +295,21 @@
        m_edges.push_back(edge(cdx, cdy, adx, ady)); 
 }
 
+void
+path::close()
+{
+       // nothing to do if path there are no edges
+       if ( m_edges.empty() ) return;
+
+       // Close it with a straight edge if needed
+       const edge& lastedge = m_edges.back();
+       if ( lastedge.m_ax != m_ax || lastedge.m_ay != m_ay )
+       {
+               edge newedge(m_ax, m_ay, m_ax, m_ay);
+               m_edges.push_back(newedge);
+       }
+}
+
 // Utility.
 
 

Index: server/shape.h
===================================================================
RCS file: /sources/gnash/gnash/server/shape.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- server/shape.h      14 Feb 2007 13:50:30 -0000      1.18
+++ server/shape.h      19 Feb 2007 10:41:57 -0000      1.19
@@ -5,7 +5,7 @@
 
 // Quadratic bezier outline shapes, the basis for most SWF rendering.
 
-/* $Id: shape.h,v 1.18 2007/02/14 13:50:30 strk Exp $ */
+/* $Id: shape.h,v 1.19 2007/02/19 10:41:57 strk Exp $ */
 
 #ifndef GNASH_SHAPE_H
 #define GNASH_SHAPE_H
@@ -91,8 +91,15 @@
                ///
                void    reset(float ax, float ay, int fill0, int fill1, int 
line);
 
+               /// Return true if this path contains no edges
                bool    is_empty() const;
 
+               /// Return true if this path contains no edges
+               bool    empty() const
+               {
+                       return is_empty();
+               }
+
                bool    point_test(float x, float y);
 
                /// Push the path into the tesselator.
@@ -219,6 +226,9 @@
                        return m_edges[n];
                }
 
+               /// Close this path with a straight line, if not already closed
+               void close();
+
        //private:
 
                /// Left fill style index (1-based)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]