gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/gui gui.cpp gui.h [release_0_7_2]


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash/gui gui.cpp gui.h [release_0_7_2]
Date: Fri, 03 Nov 2006 17:31:18 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Branch:         release_0_7_2
Changes by:     Udo Giacomozzi <udog>   06/11/03 17:31:18

Modified files:
        gui            : gui.cpp gui.h 

Log message:
        Backporting...

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.41.2.3&r2=1.41.2.4
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.33.2.2&r2=1.33.2.3

Patches:
Index: gui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.41.2.3
retrieving revision 1.41.2.4
diff -u -b -r1.41.2.3 -r1.41.2.4
--- gui.cpp     2 Nov 2006 20:09:08 -0000       1.41.2.3
+++ gui.cpp     3 Nov 2006 17:31:18 -0000       1.41.2.4
@@ -14,6 +14,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+// 
+//
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -97,11 +100,20 @@
                _xscale = width / swfwidth;
                _yscale = height / swfheight;
 
+               // always scale proportionally
+               if (_xscale < _yscale) _yscale = _xscale;
+               if (_yscale < _xscale) _xscale = _yscale;
+               
+               _renderer->set_scale(_xscale, _yscale);
+
        } else {
                log_warning("Resize request received while there's still"
                        " no movie loaded, can't correctly set movie scale");
        }
 
+       // trigger redraw
+       _redraw_flag |= (_width!=width) || (_height!=height);
+
        // set new size ?
        _width = width;
        _height = height;
@@ -179,9 +191,6 @@
 void
 Gui::notify_mouse_moved(int x, int y) 
 {
-       // for quick debugging
-       //log_msg("X:%d, Y:%d", x, y);
-
        movie_interface* m = get_current_root();
 
        if ( m->notify_mouse_moved(x, y) )
@@ -219,7 +228,10 @@
        bool redraw_flag;
 
        // Should the frame be rendered completely, even if it did not change?
-       redraw_flag = want_redraw();
+       redraw_flag = _redraw_flag || want_redraw();
+       
+       // reset class member if we do a redraw now
+       if (redraw_flag) _redraw_flag=false;
 
        // Find out the surrounding frame of all characters which
        // have been updated.
@@ -233,7 +245,8 @@
   
   
        // Avoid drawing of stopped movies
-       if ( ! changed_bounds.is_null() )
+
+       if ( ! changed_bounds.is_null() )       //vv
        {
                // Tell the GUI that we only need to update this region
                // (it may ignore this information)
@@ -270,7 +283,6 @@
        
        };
   
-  
        return true;
 }
 

Index: gui.h
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.h,v
retrieving revision 1.33.2.2
retrieving revision 1.33.2.3
diff -u -b -r1.33.2.2 -r1.33.2.3
--- gui.h       31 Oct 2006 19:31:49 -0000      1.33.2.2
+++ gui.h       3 Nov 2006 17:31:18 -0000       1.33.2.3
@@ -14,6 +14,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+// 
+//
+
 #ifndef _GUI_H_
 #define _GUI_H_
 
@@ -203,6 +206,9 @@
     unsigned int    _interval;
     /// The handler which is called to update the client area of our window.
     render_handler* _renderer;
+    /// Signals that the next frame must be re-rendered completely because the
+    /// window size did change.
+    bool            _redraw_flag;
 
 private:
 




reply via email to

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