X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcwindowgui.C;h=a5cee3517b579fa86795cb4015625b3093413a75;hp=d4e62eed5ea5e6b80b51768b305211ec36a54cc2;hb=a4de4732339bf38b5b225c533be1bdf60748f04a;hpb=d0f9735ae263eebd484a22d1e49bd3e1cd16cf70 diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index d4e62eed..a5cee351 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -109,6 +109,7 @@ CWindowGUI::CWindowGUI(MWindow *mwindow, CWindow *cwindow) inactive = 0; crop_translate = 0; eyedrop_visible = 0; + highlighted = 0; } CWindowGUI::~CWindowGUI() @@ -570,43 +571,26 @@ void CWindowGUI::drag_motion() { if(get_hidden()) return; - if(mwindow->session->current_operation == DRAG_ASSET || - mwindow->session->current_operation == DRAG_VTRANSITION || - mwindow->session->current_operation == DRAG_VEFFECT) - { - int old_status = mwindow->session->ccanvas_highlighted; - int cursor_x = get_relative_cursor_x(); - int cursor_y = get_relative_cursor_y(); - - mwindow->session->ccanvas_highlighted = get_cursor_over_window() && - cursor_x >= canvas->x && - cursor_x < canvas->x + canvas->w && - cursor_y >= canvas->y && - cursor_y < canvas->y + canvas->h; - - - if(old_status != mwindow->session->ccanvas_highlighted) - canvas->draw_refresh(); - } + if(mwindow->session->current_operation != DRAG_ASSET && + mwindow->session->current_operation != DRAG_VTRANSITION && + mwindow->session->current_operation != DRAG_VEFFECT) return; + int need_highlight = cursor_above() && get_cursor_over_window(); + if( highlighted == need_highlight ) return; + highlighted = need_highlight; + canvas->draw_refresh(); } int CWindowGUI::drag_stop() { int result = 0; if(get_hidden()) return 0; - - if((mwindow->session->current_operation == DRAG_ASSET || - mwindow->session->current_operation == DRAG_VTRANSITION || - mwindow->session->current_operation == DRAG_VEFFECT) && - mwindow->session->ccanvas_highlighted) - { -// Hide highlighting - mwindow->session->ccanvas_highlighted = 0; - canvas->draw_refresh(); - result = 1; - } - else - return 0; + if( !highlighted ) return 0; + if( mwindow->session->current_operation != DRAG_ASSET && + mwindow->session->current_operation != DRAG_VTRANSITION && + mwindow->session->current_operation != DRAG_VEFFECT) return 0; + highlighted = 0; + canvas->draw_refresh(); + result = 1; if(mwindow->session->current_operation == DRAG_ASSET) { @@ -2287,7 +2271,7 @@ void CWindowCanvas::draw_overlays() get_canvas()->set_opaque(); } - if(mwindow->session->ccanvas_highlighted) + if(gui->highlighted) { get_canvas()->set_color(WHITE); get_canvas()->set_inverse();