BC_WindowBase *window = get_canvas();
if( window && !window->get_video_on() ) {
clear(0);
- if( mwindow->uses_opengl() ) {
-// this code is to idle rendering before drawing overlays on refresh frame
-// if this is not done, occationally opengl finishs late, and overwrites
-// the x11 refresh frame and the overlay is not visible. Rarely happens.
- unlock_canvas();
- mwindow->playback_3d->finish_output(this);
- lock_canvas("CWindowCanvas::draw_refresh");
- }
if( refresh_frame && refresh_frame->get_w()>0 && refresh_frame->get_h()>0 ) {
float in_x1, in_y1, in_x2, in_y2;
float out_x1, out_y1, out_x2, out_y2;
if( draw_boundary ) {
char mask_label[BCSTRLEN];
int k = mwindow->edl->session->cwindow_mask;
- if( !prev_mask || prev_mask->is_default ||
- k < 0 || k >= prev_mask->masks.size() )
+ if( !prev_mask || k < 0 || k >= prev_mask->masks.size() )
sprintf(mask_label, "%d", k);
else
sprintf(mask_label, "%s", prev_mask->masks[k]->name);
SubMask *mask = gui->mask_keyframe->get_submask(mwindow->edl->session->cwindow_mask);
ArrayList<MaskPoint*> &mask_points = mask->points;
#endif
- MaskPoint *point = mask_points.values[gui->affected_point];
- gui->center_x = point->x;
- gui->center_y = point->y;
- gui->control_in_x = point->control_x1;
- gui->control_in_y = point->control_y1;
- gui->control_out_x = point->control_x2;
- gui->control_out_y = point->control_y2;
+ int k = gui->affected_point;
+ if( k >= 0 && k < mask_points.size() ) {
+ MaskPoint *point = mask_points.values[k];
+ gui->center_x = point->x;
+ gui->center_y = point->y;
+ gui->control_in_x = point->control_x1;
+ gui->control_in_y = point->control_y1;
+ gui->control_out_x = point->control_x2;
+ gui->control_out_y = point->control_y2;
+ }
+ else {
+ gui->center_x = gui->center_y = 0;
+ gui->control_in_x = gui->control_in_y = 0;
+ gui->control_out_x = gui->control_out_y = 0;
+ }
gui->tool_panel->raise_window();
}