tweak zoom/fullscr to remember cwdw scale after fullscr
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / vframe.C
index 4960ff26834951df49a502ecb9532b506e10c61d..293205821fc9090da5f1a4b136539cc26497c174 100644 (file)
@@ -73,11 +73,6 @@ VFrameScene::~VFrameScene()
 }
 
 
-
-
-
-
-
 //static BCCounter counter;
 
 VFramePng::VFramePng(unsigned char *png_data, double s)
@@ -829,6 +824,8 @@ int VFramePng::read_png(const unsigned char *data, long sz, double xscale, doubl
                return 1;
        }
        int ww = w * xscale, hh = h * yscale;
+       if( ww < 1 ) ww = 1;
+       if( hh < 1 ) hh = 1;
        if( ww != w || hh != h ) {
                VFrame vframe(*this);
                reallocate(NULL, -1, 0, 0, 0, ww, hh, color_model, -1);
@@ -998,12 +995,12 @@ int VFrame::get_clear_alpha() { return clear_alpha; }
 
 void VFrame::clear_frame()
 {
-       if( clear_color >= 0 ) {
-               BC_CModels::init_color(clear_color, clear_alpha, get_rows(), get_color_model(),
-                       get_y(), get_u(), get_v(), 0,0, get_w(),get_h(), get_bytes_per_line());
-       }
-       else
-               black_frame();
+       if( clear_color >= 0 &&
+           !BC_CModels::init_color(clear_color, clear_alpha,
+                       get_rows(), get_color_model(), get_y(), get_u(), get_v(),
+                       0,0, get_w(),get_h(), get_bytes_per_line()) )
+               return;
+       black_frame();
 }
 
 void VFrame::rotate90()