X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcwindowgui.C;h=19ff101e3f0383a56ba20b8e9df6a2c981922416;hb=95f86161c3b9c422bbd04ec8f685aa7e856d6dd7;hp=ea957147637ff434eb2234f4ef164302391aaadd;hpb=21eb2e0b479adf7bf846b835e5c7d9613b6f1a6d;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index ea957147..19ff101e 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -396,14 +396,18 @@ void CWindowGUI::zoom_canvas(double value, int update_menu) { float x = 0, y = 0; float zoom = !value ? get_auto_zoom() : value; - mwindow->edl->session->cwindow_scrollbars = !value ? 0 : 1; + EDL *edl = mwindow->edl; + edl->session->cwindow_scrollbars = !value ? 0 : 1; if( value ) { - float cx = canvas->get_xscroll() + 0.5f*canvas->w_visible; - float cy = canvas->get_yscroll() + 0.5f*canvas->h_visible; - float output_x = cx, output_y = cy; - canvas->output_to_canvas(mwindow->edl, 0, cx, cy); - x = output_x - cx / zoom; - y = output_y - cy / zoom; + float cx = 0.5f * canvas->w; x = cx; + float cy = 0.5f * canvas->h; y = cy; + canvas->canvas_to_output(edl, 0, x, y); + canvas->update_zoom(0, 0, zoom); + float zoom_x, zoom_y, conformed_w, conformed_h; + canvas->get_zooms(edl, 0, zoom_x, zoom_y, conformed_w, conformed_h); + x -= cx / zoom_x; + y -= cy / zoom_y; + } canvas->update_zoom((int)(x+0.5), (int)(y+0.5), zoom); @@ -484,6 +488,7 @@ int CWindowGUI::keypress_event() lock_window("CWindowGUI::keypress_event 1"); break; case 'x': + if( ctrl_down() || shift_down() || alt_down() ) break; unlock_window(); mwindow->gui->lock_window("CWindowGUI::keypress_event 2"); mwindow->cut(); @@ -561,8 +566,10 @@ int CWindowGUI::keypress_event() } break; - case KEY_F1: cwindow_operation = CWINDOW_PROTECT; break; - case KEY_F2: cwindow_operation = CWINDOW_ZOOM; break; + case KEY_F1: if( shift_down() ) { mwindow->toggle_camera_xyz(); break; } + cwindow_operation = CWINDOW_PROTECT; break; + case KEY_F2: if( shift_down() ) { mwindow->toggle_projector_xyz(); break; } + cwindow_operation = CWINDOW_ZOOM; break; case KEY_F3: cwindow_operation = CWINDOW_MASK; break; case KEY_F4: cwindow_operation = CWINDOW_RULER; break; case KEY_F5: cwindow_operation = CWINDOW_CAMERA; break; @@ -646,14 +653,12 @@ int CWindowGUI::drag_stop() if(mwindow->session->drag_assets->total || mwindow->session->drag_clips->total) { - mwindow->gui->lock_window("CWindowGUI::drag_stop 5"); + mwindow->gui->lock_window("CWindowGUI::drag_stop 1"); mwindow->undo->update_undo_before(_("insert assets"), 0); - mwindow->gui->unlock_window(); } if(mwindow->session->drag_assets->total) { - mwindow->gui->lock_window("CWindowGUI::drag_stop 1"); mwindow->clear(0); mwindow->load_assets(mwindow->session->drag_assets, mwindow->edl->local_session->get_selectionstart(), @@ -668,7 +673,6 @@ int CWindowGUI::drag_stop() if(mwindow->session->drag_clips->total) { - mwindow->gui->lock_window("CWindowGUI::drag_stop 2"); mwindow->clear(0); mwindow->paste_edls(mwindow->session->drag_clips, LOADMODE_PASTE, @@ -688,7 +692,7 @@ int CWindowGUI::drag_stop() mwindow->gui->update(1, 1, 1, 1, 0, 1, 0); mwindow->undo->update_undo_after(_("insert assets"), LOAD_ALL); mwindow->gui->unlock_window(); - mwindow->sync_parameters(LOAD_ALL); + mwindow->sync_parameters(CHANGE_ALL); } } @@ -1085,19 +1089,27 @@ void CWindowCanvas::draw_refresh(int flush) in_x2 > in_x1 && in_y2 > in_y1) { +// input scaled from session to refresh frame coordinates + int ow = get_output_w(mwindow->edl); + int oh = get_output_h(mwindow->edl); + int rw = refresh_frame->get_w(); + int rh = refresh_frame->get_h(); + float xs = (float)rw / ow; + float ys = (float)rh / oh; + in_x1 *= xs; in_x2 *= xs; + in_y1 *= ys; in_y2 *= ys; // Can't use OpenGL here because it is called asynchronously of the // playback operation. get_canvas()->draw_vframe(refresh_frame, (int)out_x1, (int)out_y1, (int)(out_x2 - out_x1), - (int)(out_y2 - out_y1)); -// if refresh_frame session geometry... -// (int)in_x1, -// (int)in_y1, -// (int)(in_x2 - in_x1), -// (int)(in_y2 - in_y1), -// 0); + (int)(out_y2 - out_y1), + (int)in_x1, + (int)in_y1, + (int)(in_x2 - in_x1), + (int)(in_y2 - in_y1), + 0); } } else @@ -2982,8 +2994,13 @@ int CWindowCanvas::test_bezier(int button_press, { last_center_x = gui->affected_x->get_value(); last_center_y = gui->affected_y->get_value(); - float x = gui->center_x + cursor_x - gui->x_origin; - float y = gui->center_y + cursor_y - gui->y_origin; + float dx = cursor_x - gui->x_origin; + float dy = cursor_y - gui->y_origin; + if(gui->current_operation == CWINDOW_CAMERA ) { + dx = -dx; dy = -dy; + } + float x = gui->center_x + dx; + float y = gui->center_y + dy; gui->affected_x->set_value(x); gui->affected_y->set_value(y); if( !EQUIV(last_center_x, x) || !EQUIV(last_center_y, y) )