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


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash/gui gui.cpp gui.h
Date: Thu, 02 Nov 2006 14:00:35 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   06/11/02 14:00:35

Modified files:
        gui            : gui.cpp gui.h 

Log message:
        Redraw on rescale

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.34&r2=1.35

Patches:
Index: gui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- gui.cpp     29 Oct 2006 18:34:10 -0000      1.43
+++ gui.cpp     2 Nov 2006 14:00:34 -0000       1.44
@@ -100,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;
@@ -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.
@@ -273,7 +285,6 @@
        
        };
   
-  
        return true;
 }
 

Index: gui.h
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- gui.h       29 Oct 2006 18:34:10 -0000      1.34
+++ gui.h       2 Nov 2006 14:00:34 -0000       1.35
@@ -206,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]