this->mwindow = mwindow;
this->cwindow = cwindow;
affected_track = 0;
- affected_x = 0;
- affected_y = 0;
- affected_z = 0;
+ affected_x = affected_y = affected_z = 0;
mask_keyframe = 0;
orig_mask_keyframe = new MaskAuto(0, 0);
affected_point = 0;
- x_offset = 0;
- y_offset = 0;
- x_origin = 0;
- y_origin = 0;
+ x_offset = y_offset = 0;
+ x_origin = y_origin = 0;
current_operation = CWINDOW_NONE;
tool_panel = 0;
- translating_zoom = 0;
active = 0;
inactive = 0;
- crop_translate = 0;
+ crop_handle = -1; crop_translate = 0;
+ crop_origin_x = crop_origin_y = 0;
+ crop_origin_x1 = crop_origin_y1 = 0;
+ crop_origin_x2 = crop_origin_y2 = 0;
eyedrop_visible = 0;
+ eyedrop_x = eyedrop_y = 0;
+ ruler_origin_x = ruler_origin_y = 0;
+ ruler_handle = -1; ruler_translate = 0;
+ center_x = center_y = center_z = 0;
+ control_in_x = control_in_y = 0;
+ control_out_x = control_out_y = 0;
+ translating_zoom = 0;
highlighted = 0;
}
flash(0);
composite_panel->reposition_buttons(mwindow->theme->ccomposite_x,
- mwindow->theme->ccomposite_y);
+ mwindow->theme->ccomposite_y, mwindow->theme->ccomposite_h);
canvas->reposition_window(mwindow->edl,
mwindow->theme->ccanvas_x,
void CWindowGUI::zoom_canvas(double value, int update_menu)
{
- EDL *edl = mwindow->edl;
- float x = canvas->get_xscroll(), y = canvas->get_yscroll();
- float old_zoom = mwindow->edl->session->cwindow_zoom;
- float new_zoom = !value ? get_auto_zoom() : value;
- edl->session->cwindow_scrollbars = !value ? 0 : 1;
+ float x = 0, y = 0;
+ float zoom = !value ? get_auto_zoom() : value;
+ mwindow->edl->session->cwindow_scrollbars = !value ? 0 : 1;
if( value ) {
- float z = (1 - old_zoom / new_zoom) / 2;
- x += canvas->w_visible * z;
- y += canvas->h_visible * z;
+ 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;
}
- else
- x = y = 0;
-
- canvas->update_zoom((int)x, (int)y, new_zoom);
- if( !value )
- mwindow->edl->session->cwindow_scrollbars = 0;
+ canvas->update_zoom((int)(x+0.5), (int)(y+0.5), zoom);
if( update_menu )
zoom_panel->update(value);
if( mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM )
- composite_panel->cpanel_zoom->update(new_zoom);
+ composite_panel->cpanel_zoom->update(zoom);
canvas->reposition_window(mwindow->edl,
mwindow->theme->ccanvas_x, mwindow->theme->ccanvas_y,
CWrapper(set_outpoint)
CWrapper(clear_inpoint)
CWrapper(clear_outpoint)
-CWrapper(to_clip)
CWrapper(toggle_label)
CWrapper(prev_label)
CWrapper(next_label)
CWrapper(prev_edit)
CWrapper(next_edit)
+void CWindowEditing::to_clip()
+{
+ mwindow->to_clip(mwindow->edl, _("composer window: "));
+}
CWindowMeters::CWindowMeters(MWindow *mwindow,
float x, y;
float zoom = 0;
- if( !mwindow->edl->session->cwindow_scrollbars ) {
- mwindow->edl->session->cwindow_scrollbars = 1;
- x = (mwindow->edl->session->output_w - w) / 2;
- y = (mwindow->edl->session->output_h - h) / 2;
- zoom = 1;
- }
- else {
+ if( mwindow->edl->session->cwindow_scrollbars ) {
if( *gui->zoom_panel->get_text() != 'x' ) {
// Find current zoom in table
int idx = total_zooms; float old_zoom = get_zoom();
}
}
x = get_cursor_x(); y = get_cursor_y();
+ if( !zoom ) {
+ mwindow->edl->session->cwindow_scrollbars = 0;
+ gui->zoom_panel->update(0);
+ zoom = gui->get_auto_zoom();
+ }
+ else {
+ gui->zoom_panel->ZoomPanel::update(zoom);
+ float output_x = x, output_y = y;
+ canvas_to_output(mwindow->edl, 0, output_x, output_y);
+ x = output_x - x / zoom;
+ y = output_y - y / zoom;
+ }
}
- if( !zoom ) {
- mwindow->edl->session->cwindow_scrollbars = 0;
- gui->zoom_panel->update(0);
- zoom = gui->get_auto_zoom();
+ else {
+ mwindow->edl->session->cwindow_scrollbars = 1;
+ x = (mwindow->edl->session->output_w - w) / 2;
+ y = (mwindow->edl->session->output_h - h) / 2;
+ zoom = 1;
}
- else
- gui->zoom_panel->ZoomPanel::update(zoom);
-
- float output_x = x, output_y = y;
- canvas_to_output(mwindow->edl, 0, output_x, output_y);
- x = output_x - x / zoom;
- y = output_y - y / zoom;
update_zoom((int)x, (int)y, zoom);
gui->composite_panel->cpanel_zoom->update(zoom);