X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcanvas.C;h=cd59b62ce7d12c03bf33d9bbcd42eb737016775e;hb=07af5297688e2f888e0a309eab76293093a003bb;hp=be0a2af0923dc32f2352ac433fb59732c6c5d5a0;hpb=b350aa5a1ccbadcb5f794183c443c0738cd1e9ab;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index be0a2af0..cd59b62c 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -36,20 +36,15 @@ -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; @@ -903,17 +898,61 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) void Canvas::clear(int flash) { - BC_WindowBase *cwdw = get_canvas(); - if( !cwdw ) return; - cwdw->set_bg_color(get_clear_color()); - cwdw->clear_box(0,0, cwdw->get_w(), cwdw->get_h()); - if( flash ) cwdw->flash(); + BC_WindowBase *window = get_canvas(); + if( !window ) return; + window->set_bg_color(get_clear_color()); + window->clear_box(0,0, window->get_w(), window->get_h()); + if( flash ) window->flash(); +} + +void Canvas::clear_borders(EDL *edl) +{ + BC_WindowBase *window = get_canvas(); + if( !window ) return; + + int window_w = window->get_w(); + int window_h = window->get_h(); + float output_x1,output_y1, output_x2,output_y2; + float canvas_x1,canvas_y1, canvas_x2,canvas_y2; + get_transfers(edl, + output_x1, output_y1, output_x2, output_y2, + canvas_x1, canvas_y1, canvas_x2, canvas_y2); + int color = get_clear_color(); + window->set_color(color); + + if( canvas_y1 > 0 ) { + window->draw_box(0, 0, window_w, canvas_y1); + window->flash(0, 0, window_w, canvas_y1); + } + + if( canvas_y2 < window_h ) { + window->draw_box(0, canvas_y2, window_w, window_h-canvas_y2); + window->flash(0, canvas_y2, window_w, window_h-canvas_y2); + } + + if( canvas_x1 > 0 ) { + window->draw_box(0, canvas_y1, canvas_x1, canvas_y2-canvas_y1); + window->flash(0, canvas_y1, canvas_x1, canvas_y2-canvas_y1); + } + + if( canvas_x2 < window_w ) { + window->draw_box(canvas_x2, canvas_y1, + window_w-canvas_x2, canvas_y2-canvas_y1); + window->flash(canvas_x2, canvas_y1, + window_w-canvas_x2, canvas_y2-canvas_y1); + } } +int Canvas::get_clear_color() +{ + BC_WindowBase *cwdw = get_canvas(); + if( !cwdw ) return 0; + return cwdw->get_bg_color(); +} CanvasOutput::CanvasOutput(Canvas *canvas, int x, int y, int w, int h) - : BC_SubWindow(x, y, w, h, BLACK) + : BC_SubWindow(x, y, w, h, canvas->get_clear_color()) { this->canvas = canvas; } @@ -955,7 +994,7 @@ int CanvasOutput::keypress_event() CanvasFullScreen::CanvasFullScreen(Canvas *canvas, int w, int h) - : BC_FullScreen(canvas->subwindow, w, h, BLACK, 0, 0, 0) + : BC_FullScreen(canvas->subwindow, w, h, canvas->get_clear_color(), 0, 0, 0) { this->canvas = canvas; }