From: Good Guy Date: Sun, 23 Sep 2018 16:54:29 +0000 (-0600) Subject: opengl edge glitch, opengl projector fix, zoom slider, label close fix X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=3ceaf97d3b161445161eb5d48f3e8d5e9c34e3f8 opengl edge glitch, opengl projector fix, zoom slider, label close fix --- diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index 3e980b8b..c854ce31 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -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); diff --git a/cinelerra-5.1/cinelerra/labeledit.C b/cinelerra-5.1/cinelerra/labeledit.C index 22c5252a..22681918 100644 --- a/cinelerra-5.1/cinelerra/labeledit.C +++ b/cinelerra-5.1/cinelerra/labeledit.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/labeledit.h b/cinelerra-5.1/cinelerra/labeledit.h index 9c6a9ab6..80bf1f12 100644 --- a/cinelerra-5.1/cinelerra/labeledit.h +++ b/cinelerra-5.1/cinelerra/labeledit.h @@ -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 diff --git a/cinelerra-5.1/cinelerra/playback3d.C b/cinelerra-5.1/cinelerra/playback3d.C index ba21998c..d7da2f50 100644 --- a/cinelerra-5.1/cinelerra/playback3d.C +++ b/cinelerra-5.1/cinelerra/playback3d.C @@ -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: diff --git a/cinelerra-5.1/guicast/bctexture.C b/cinelerra-5.1/guicast/bctexture.C index 59e21810..7cebeefc 100644 --- a/cinelerra-5.1/guicast/bctexture.C +++ b/cinelerra-5.1/guicast/bctexture.C @@ -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); diff --git a/cinelerra-5.1/guicast/vframe3d.C b/cinelerra-5.1/guicast/vframe3d.C index aba006b8..649a3b19 100644 --- a/cinelerra-5.1/guicast/vframe3d.C +++ b/cinelerra-5.1/guicast/vframe3d.C @@ -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);