opengl edge glitch, opengl projector fix, zoom slider, label close fix
authorGood Guy <[email protected]>
Sun, 23 Sep 2018 16:54:29 +0000 (10:54 -0600)
committerGood Guy <[email protected]>
Sun, 23 Sep 2018 16:54:29 +0000 (10:54 -0600)
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/labeledit.C
cinelerra-5.1/cinelerra/labeledit.h
cinelerra-5.1/cinelerra/playback3d.C
cinelerra-5.1/guicast/bctexture.C
cinelerra-5.1/guicast/vframe3d.C

index 3e980b8b99308e7d89c99de872db4bc413af10cd..c854ce31cac4eeb8c0dbb6b79ecf5856102f723c 100644 (file)
@@ -396,14 +396,18 @@ void CWindowGUI::zoom_canvas(double value, int update_menu)
 {
        float x = 0, y = 0;
        float zoom = !value ? get_auto_zoom() : value;
-       mwindow->edl->session->cwindow_scrollbars = !value ? 0 : 1;
+       EDL *edl = mwindow->edl;
+       edl->session->cwindow_scrollbars = !value ? 0 : 1;
        if( value ) {
-               float cx = canvas->get_xscroll() + 0.5f*canvas->w_visible;
-               float cy = canvas->get_yscroll() + 0.5f*canvas->h_visible;
-               float output_x = cx, output_y = cy;
-               canvas->output_to_canvas(mwindow->edl, 0, cx, cy);
-               x = output_x - cx / zoom;
-               y = output_y - cy / zoom;
+               float cx = 0.5f * canvas->w;  x = cx;
+               float cy = 0.5f * canvas->h;  y = cy;
+               canvas->canvas_to_output(edl, 0, x, y);
+               canvas->update_zoom(0, 0, zoom);
+               float zoom_x, zoom_y, conformed_w, conformed_h;
+               canvas->get_zooms(edl, 0, zoom_x, zoom_y, conformed_w, conformed_h);
+               x -= cx / zoom_x;
+               y -= cy / zoom_y;
+
        }
        canvas->update_zoom((int)(x+0.5), (int)(y+0.5), zoom);
 
index 22c5252a802dac626ce676ad56e20ef01c7bd4ad..22681918de4c0ae8a245a4126682fc422501604a 100644 (file)
@@ -61,7 +61,10 @@ void LabelEdit::handle_close_event(int result)
 
 void LabelEdit::handle_done_event(int result)
 {
-       awindow->gui->async_update_assets();
+       if( !result ) {
+               strcpy(label->textstr, label_edit_window->textbox->get_text());
+               awindow->gui->async_update_assets();
+       }
 }
 
 BC_Window *LabelEdit::new_gui()
@@ -91,7 +94,6 @@ void LabelEditWindow::create_objects()
 
        int x = 10, y = 10;
        int x1 = x;
-       BC_TextBox *textbox;
        BC_Title *title;
 
        add_subwindow(title = new BC_Title(x1, y, _("Label Text:")));
@@ -114,7 +116,6 @@ LabelEditComments::LabelEditComments(LabelEditWindow *window, int x, int y, int
 
 int LabelEditComments::handle_event()
 {
-       strcpy(window->label->textstr, get_text());
        return 1;
 }
 
index 9c6a9ab60da51c7e2cd7b60ba82ff2d5b72261fc..80bf1f127e350f7254b196af5bedb6aa87a13d95 100644 (file)
@@ -61,10 +61,10 @@ public:
 
        void create_objects();
 
-// Use this copy of the pointer in LabelEdit since multiple windows are possible
        Label *label;
        MWindow *mwindow;
        LabelEdit *thread;
+       BC_TextBox *textbox;
 };
 
 class LabelEditTitle : public BC_TextBox
index ba21998ccdc37675aab25a20b905e34cf42a35bd..d7da2f505a92c08a8177cab2003280277f0953ff 100644 (file)
@@ -659,6 +659,13 @@ void Playback3D::write_buffer_sync(Playback3DCommand *command)
                                window->enable_opengl();
 // Composite texture to screen and swap buffer
                        case VFrame::TEXTURE:
+                               if( !flip_y ) {
+                                       int fh1 = command->frame->get_h()-1;
+                                       float in_y1 = fh1 - command->in_y1;
+                                       float in_y2 = fh1 - command->in_y2;
+                                       command->in_y1 = in_y2;
+                                       command->in_y2 = in_y1;
+                               }
                                draw_output(command, flip_y);
                                break;
                        default:
index 59e21810d50ba64ffd07c23ebb4ca240592b4d11..7cebeefc2f3d9b2b3dadf5c1034c2320702e41ad 100644 (file)
@@ -216,8 +216,8 @@ void BC_Texture::bind(int texture_unit)
 
 // GL_REPEAT in this case causes the upper left corners of the masks
 // to blur.
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
 // Get the texture to alpha blend
                        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
index aba006b8a11c43270ec1ab5ef53f16ae0b343105..649a3b1997343d9577a0b885ec95da2f153e7adf 100644 (file)
@@ -266,7 +266,7 @@ void VFrame::init_screen(int w, int h)
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
 // Shift down and right so 0,0 is the top left corner
-       glTranslatef(-w/2, h/2, 0.0);
+       glTranslatef(-(w-1)/2.f, (h-1)/2.f, 0.0);
        glTranslatef(0.0, 0.0, -(far + near) / 2);
 
        glDisable(GL_DEPTH_TEST);