mask mousewheel segv bug, mask opengl sw fallback read to ram, fix tiff config withou...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / cwindowgui.C
index 3e9bf9ecd8e150fad157a3354ac8f3e90f0d48ec..af778e598350e08dc69eb829a6578edc10bf7496 100644 (file)
@@ -1129,14 +1129,6 @@ void CWindowCanvas::draw_refresh(int flush)
        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;
@@ -1757,8 +1749,7 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender,
                                                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);
@@ -2027,13 +2018,21 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender,
                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();
        }