gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/server DynamicShape.cpp sprite_instance.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash/server DynamicShape.cpp sprite_instance.cpp
Date: Mon, 19 Feb 2007 11:21:58 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/19 11:21:58

Modified files:
        server         : DynamicShape.cpp sprite_instance.cpp 

Log message:
        Fix calls to lineStyle with thickness set to 0 (or omitted)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DynamicShape.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.172&r2=1.173

Patches:
Index: DynamicShape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/DynamicShape.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- DynamicShape.cpp    19 Feb 2007 11:08:22 -0000      1.1
+++ DynamicShape.cpp    19 Feb 2007 11:21:58 -0000      1.2
@@ -16,7 +16,7 @@
 
 
 
-/* $Id: DynamicShape.cpp,v 1.1 2007/02/19 11:08:22 strk Exp $ */
+/* $Id: DynamicShape.cpp,v 1.2 2007/02/19 11:21:58 strk Exp $ */
 
 #include "DynamicShape.h"
 
@@ -108,8 +108,12 @@
 void
 DynamicShape::lineStyle(uint16_t thickness, const rgba& color)
 {
+       if ( thickness ) {
        line_style style(thickness, color);
        _currline = add_line_style(style);
+       } else {
+               _currline = 0;
+       }
 
        startNewPath();
 }

Index: sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -b -r1.172 -r1.173
--- sprite_instance.cpp 19 Feb 2007 11:08:22 -0000      1.172
+++ sprite_instance.cpp 19 Feb 2007 11:21:58 -0000      1.173
@@ -925,20 +925,17 @@
 {
        sprite_instance* sprite = ensure_sprite(fn.this_ptr);
 
-       if ( fn.nargs < 1 )
-       {
-               IF_VERBOSE_ASCODING_ERRORS(
-                       log_aserror("MovieClip.lineStyle(<thickness>, [<rgb>], 
[<alpha>]) takes at least 1 arg");
-               );
-               return;
-       }
-
-       uint16_t thickness = 
uint16_t(PIXELS_TO_TWIPS(uint16_t(fclamp(fn.arg(0).to_number(), 0, 255))));
+       uint16_t thickness = 0;
        uint8_t r = 0;
        uint8_t g = 0;
        uint8_t b = 0;
        uint8_t a = 255;
 
+
+       if ( fn.nargs > 0 )
+       {
+               thickness = 
uint16_t(PIXELS_TO_TWIPS(uint16_t(fclamp(fn.arg(0).to_number(), 0, 255))));
+
        if ( fn.nargs > 1 )
        {
                // 2^24 is the max here
@@ -946,13 +943,16 @@
                r = uint8_t( (rgbval&0xFF0000) >> 16);
                g = uint8_t( (rgbval&0x00FF00) >> 8);
                b = uint8_t( (rgbval&0x0000FF) );
-       }
 
        if ( fn.nargs > 2 )
        {
                float alphaval = fclamp(fn.arg(2).to_number(), 0, 255);
                a = uint8_t(alphaval);
        }
+               }
+
+       }
+
 
        rgba color(r, g, b, a);
        //log_msg("Color: %s", color.toString().c_str());




reply via email to

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