mask tweaks, focus follows centroid, gradient/colorpicker rework, no hard edges in...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / trackcanvas.C
index 748b8b2b8878ec25ba5a769709e7d3effd2d408f..ab9cf977261b71712f96966afafad16136752dd5 100644 (file)
@@ -1888,6 +1888,8 @@ void TrackCanvas::refresh_plugintoggles()
 
 void TrackCanvas::draw_hard_edges()
 {
+       if( !mwindow->edl->session->auto_conf->hard_edges )
+               return;
        int64_t x, y, w, h;
 
        for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
@@ -2170,6 +2172,7 @@ int TrackCanvas::do_keyframes(int cursor_x,
                pankeyframe_pixmap,
                modekeyframe_pixmap,
                maskkeyframe_pixmap,
+               0,
        };
 
 
@@ -2468,12 +2471,23 @@ void TrackCanvas::draw_floatauto(FloatAuto *current,
        CLAMP(y1, ymin, ymax);
        CLAMP(y2, ymin, ymax);
 
-       if(y2 - 1 > y1)
-       {
-               set_color(BLACK);
-               draw_box(x1 + 1, y1 + 1, x2 - x1, y2 - y1);
-               set_color(color);
-               draw_box(x1, y1, x2 - x1, y2 - y1);
+       if( y2-1 > y1 ) {
+               if( current->curve_mode == FloatAuto::LINEAR ) {
+                       draw_box(x1, y1, x2 - x1, y2 - y1);
+               }
+               else {
+                       ArrayList<int> polygon_x;
+                       ArrayList<int> polygon_y;
+                       polygon_x.append((x1 + x2) / 2 + 1);
+                       polygon_y.append(y1 + 1);
+                       polygon_x.append(x2 + 1);
+                       polygon_y.append((y1 + y2) / 2 + 1);
+                       polygon_x.append((x1 + x2) / 2 + 1);
+                       polygon_y.append(y2 + 1);
+                       polygon_x.append(x1 + 1);
+                       polygon_y.append((y1 + y2) / 2 + 1);
+                       fill_polygon(&polygon_x, &polygon_y);
+               }
        }
 
 // show bezier control points (only) if this
@@ -3651,16 +3665,20 @@ int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color, int show)
        set_color(color);
        draw_line(ax, 0, ax, get_h());
 
+       char text[BCSTRLEN];
        if( show ) {
-               char text[BCSTRLEN];
                if( auto_keyframe->is_floatauto() ) {
                        FloatAuto *float_auto = (FloatAuto *)auto_keyframe;
                        sprintf(text, "%0.2f", float_auto->get_value());
                }
-               else {
+               else if( auto_keyframe->is_intauto() ) {
                        IntAuto *int_auto = (IntAuto *)auto_keyframe;
                        sprintf(text, "%d", int_auto->value);
                }
+               else
+                       show = 0;
+       }
+       if( show ) {
                int font = MEDIUMFONT;
                int tw = get_text_width(font, text)  + TOOLTIP_MARGIN * 2;
                int th = get_text_height(font, text) + TOOLTIP_MARGIN * 2;
@@ -3868,7 +3886,6 @@ int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode)
                delete video_cache;
                mwindow->cwindow->gui->lock_window("TrackCanvas::render_handle_frame 0");
                Canvas *canvas = mwindow->cwindow->gui->canvas;
-               canvas->lock_canvas("TrackCanvas::render_handle_frame 1");
                int w = canvas->w, h = canvas->h, w2 = w/2, h2 = h/2;
                int lx = 0, ly = h2/2, rx = w2, ry = h2/2;
                BC_WindowBase *window = canvas->get_canvas();
@@ -3877,7 +3894,6 @@ int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode)
                window->draw_vframe(&vlt, lx,ly, w2,h2, 0,0,vlt.get_w(),vlt.get_h());
                window->draw_vframe(&vrt, rx,ry, w2,h2, 0,0,vrt.get_w(),vrt.get_h());
                window->flash(1);
-               canvas->unlock_canvas();
                mwindow->cwindow->gui->unlock_window();
                break; }
        case 1:
@@ -4785,7 +4801,7 @@ int TrackCanvas::do_edit_handles(int cursor_x, int cursor_y, int button_press,
                        update_overlay = 1;
                }
        }
-       else if( result < 0 ) {
+       else if( result < 0 && !edit_result->silence() ) {
                mwindow->undo->update_undo_before();
                if( !shift_down() ) {
                        if( handle_result == 0 )