add binfolder path relative filters, fix gbrp color model, vwdw timebar tweaks, title...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / dragcheckbox.C
index 559851eb9a90754afef92c06c863f19f24008e53..8db8ac35953e37985657630f02f0fbd838da239f 100644 (file)
@@ -159,7 +159,9 @@ int DragCheckBox::grab_event(XEvent *event)
                         fabs(drag_dy = cursor_y-y1) < r ) dragging = 8;
                else if( fabs(drag_dx = cursor_x-x1) < r &&  // x1,y1
                         fabs(drag_dy = cursor_y-y1) < r ) dragging = 9;
+               else
                        return 0;
+               return 1;
        }
        int cur_x = cursor_x - drag_dx;
        int cur_y = cursor_y - drag_dy;
@@ -231,6 +233,20 @@ int DragCheckBox::grab_event(XEvent *event)
        return 1;
 }
 
+
+void DragCheckBox::bound()
+{
+       Track *track = get_drag_track();
+       int trk_w = track->track_w, trk_h = track->track_h;
+       float x1 = drag_x, x2 = x1 + drag_w;
+       float y1 = drag_y, y2 = y1 + drag_h;
+       bclamp(x1, 0, trk_w);  bclamp(x2, 0, trk_w);
+       bclamp(y1, 0, trk_h);  bclamp(y2, 0, trk_h);
+       if( x1 >= x2 ) { if( x2 > 0 ) x1 = x2-1; else x2 = (x1=0)+1; }
+       if( y1 >= y2 ) { if( x2 > 0 ) y1 = y2-1; else y2 = (y1=0)+1; }
+       drag_x = x1;  drag_y = y1;  drag_w = x2-x1;  drag_h = y2-y1;
+}
+
 void DragCheckBox::draw_boundary(VFrame *out,
        int x, int y, int w, int h)
 {
@@ -272,5 +288,6 @@ void DragCheckBox::draw_boundary(VFrame *out,
                out->draw_line(x2,y2-r, x2-r,y2);
                out->draw_line(x0,y2-r, x0+r,y2);
        }
+       out->set_stiple(0);
 }