patch expander changes, rework show assets/titles/transitions, add projector/camera...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / vpatchgui.C
index 8b9c0b4766d626c5f9c5b05e38999131d61f2363..2d01e0144c9cfa7bfbd7a574d28833e14b61ccc2 100644 (file)
@@ -89,10 +89,10 @@ int VPatchGUI::update(int x, int y)
        int x1 = 0;
        int y1 = PatchGUI::update(x, y);
 
+       int y2 = y1 + mwindow->theme->fade_h;
        if( fade ) {
-               if( h - y1 < mwindow->theme->fade_h ) {
-                       delete fade;
-                       fade = 0;
+               if( h < y2 ) {
+                       delete fade;  fade = 0;
                }
                else {
                        fade->update(fade->get_w(), mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(),
@@ -100,15 +100,16 @@ int VPatchGUI::update(int x, int y)
                                     mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_VIDEO_FADE]);
                }
        }
-       else
-       if( h - y1 >= mwindow->theme->fade_h ) {
+       else if( h >= y2 ) {
                patchbay->add_subwindow(fade = new VFadePatch(mwindow, this, x1+x, y1+y,
                        patchbay->get_w() - 10));
        }
-       y1 += mwindow->theme->fade_h;
+       if( fade )
+               y1 = y2;
 
+       y2 = y1 + mwindow->theme->mode_h;
        if( mode ) {
-               if( h - y1 < mwindow->theme->mode_h ) {
+               if( h < y2 ) {
                        delete mix;    mix = 0;
                        delete mode;   mode = 0;
                        delete nudge;  nudge = 0;
@@ -122,8 +123,7 @@ int VPatchGUI::update(int x, int y)
                        nudge->update();
                }
        }
-       else
-       if( h - y1 >= mwindow->theme->mode_h ) {
+       else if( h >= y2 ) {
                patchbay->add_subwindow(mix = new VMixPatch(mwindow, this, x1+x, y1+y+5));
                x1 += mix->get_w();
                patchbay->add_subwindow(mode = new VModePatch(mwindow, this, x1+x, y1+y));
@@ -132,13 +132,13 @@ int VPatchGUI::update(int x, int y)
                patchbay->add_subwindow(nudge = new NudgePatch(mwindow, this, x1+x, y1+y,
                        patchbay->get_w() - x1-x - 10));
        }
+       if( mode )
+               y1 = y2;
 
-       y1 += mwindow->theme->mode_h;
        return y1;
 }
 
 
-
 void VPatchGUI::synchronize_fade(float value_change)
 {
        if( fade && !change_source ) {