fix segv for plugin render_gui when plugin moved up/dn, opencv build fixes, opts...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / canvas.C
index f0ea0a120ba63b2446d9e503e4e5fa156f55241b..125472aeec3b643daf2465b62497538326ab3e27 100644 (file)
 
 
 
-Canvas::Canvas(MWindow *mwindow,
-       BC_WindowBase *subwindow,
-       int x,
-       int y,
-       int w,
-       int h,
-       int output_w,
-       int output_h,
+Canvas::Canvas(MWindow *mwindow, BC_WindowBase *subwindow,
+       int x, int y, int w, int h, int output_w, int output_h,
        int use_scrollbars)
 {
        reset();
 
-       if(w < 10) w = 10;
-       if(h < 10) h = 10;
+       int xs10 = xS(10), ys10 = yS(10);
+       if(w < xs10) w = xs10;
+       if(h < ys10) h = ys10;
        this->mwindow = mwindow;
        this->subwindow = subwindow;
        this->x = x;
@@ -905,17 +900,14 @@ void Canvas::clear(int flash)
 {
        BC_WindowBase *cwdw = get_canvas();
        if( !cwdw )  return;
-       cwdw->set_bg_color(BLACK);
+       cwdw->set_bg_color(get_clear_color());
        cwdw->clear_box(0,0, cwdw->get_w(), cwdw->get_h());
        if( flash ) cwdw->flash();
 }
 
 
 CanvasOutput::CanvasOutput(Canvas *canvas,
-    int x,
-    int y,
-    int w,
-    int h)
+    int x, int y, int w, int h)
  : BC_SubWindow(x, y, w, h, BLACK)
 {
        this->canvas = canvas;