update version, zoom tweeks
authorGood Guy <[email protected]>
Wed, 31 May 2017 23:04:19 +0000 (17:04 -0600)
committerGood Guy <[email protected]>
Wed, 31 May 2017 23:04:19 +0000 (17:04 -0600)
cinelerra-5.1/PKGBUILD
cinelerra-5.1/cinelerra.spec
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/debian/changelog
cinelerra-5.1/debian/control

index d422868d92ad010288099418eddaa458d418857b..9e124fc4959855bf75efc8fbb25975b1f1b31176 100644 (file)
@@ -1,7 +1,7 @@
 # Maintainer: goodguy <lists.cinelerra-cv.org>
 pkgname=cin
 pkgver=5.1
-pkgrel=20170429
+pkgrel=20170531
 pkgdesc="Cinelerra git://git.cinelerra-cv.org/goodguy/cinelerra.git ($pkgrel)"
 arch=('x86_64')
 url="http://www.cinelerra-cv.org"
index dd735f11ed1d4c1f7094fb8a3d64f49e6af6d4a0..cb640284fa7a0ae6d8766b9fb36a7aece8c530f8 100644 (file)
@@ -1,4 +1,4 @@
-%define ver 20170429
+%define ver 20170531
 Summary: Multimedia Editing and construction
 Name: cinelerra
 Version: 5.1
index bc37551a84bf87b49f070cd8d4583cf660c9ec7c..6d431550d156b1617a0e3a6d8a2e16a6f4317e03 100644 (file)
@@ -370,27 +370,23 @@ float CWindowGUI::get_auto_zoom()
 
 void CWindowGUI::zoom_canvas(double value, int update_menu)
 {
-       EDL *edl = mwindow->edl;
-       float x = canvas->get_xscroll(), y = canvas->get_yscroll();
-       float old_zoom = mwindow->edl->session->cwindow_zoom;
-       float new_zoom = !value ? get_auto_zoom() : value;
-       edl->session->cwindow_scrollbars = !value ? 0 : 1;
+       float x = 0, y = 0;
+       float zoom = !value ? get_auto_zoom() : value;
+       mwindow->edl->session->cwindow_scrollbars = !value ? 0 : 1;
        if( value ) {
-               float z = (1 - old_zoom / new_zoom) / 2;
-               x += canvas->w_visible * z;
-               y += canvas->h_visible * z;
+               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;
        }
-       else
-               x = y = 0;
-
-       canvas->update_zoom((int)x, (int)y, new_zoom);
-       if( !value )
-               mwindow->edl->session->cwindow_scrollbars = 0;
+       canvas->update_zoom((int)x, (int)y, zoom);
 
        if( update_menu )
                zoom_panel->update(value);
        if( mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM )
-               composite_panel->cpanel_zoom->update(new_zoom);
+               composite_panel->cpanel_zoom->update(zoom);
 
        canvas->reposition_window(mwindow->edl,
                mwindow->theme->ccanvas_x, mwindow->theme->ccanvas_y,
@@ -2944,13 +2940,7 @@ int CWindowCanvas::test_zoom(int &redraw)
        float x, y;
        float zoom = 0;
 
-       if( !mwindow->edl->session->cwindow_scrollbars ) {
-               mwindow->edl->session->cwindow_scrollbars = 1;
-               x = (mwindow->edl->session->output_w - w) / 2;
-               y = (mwindow->edl->session->output_h - h) / 2;
-               zoom = 1;
-       }
-       else {
+       if( mwindow->edl->session->cwindow_scrollbars ) {
                if( *gui->zoom_panel->get_text() != 'x' ) {
 // Find current zoom in table
                        int idx = total_zooms;  float old_zoom = get_zoom();
@@ -2963,19 +2953,25 @@ int CWindowCanvas::test_zoom(int &redraw)
                        }
                }
                x = get_cursor_x();  y = get_cursor_y();
+               if( !zoom ) {
+                       mwindow->edl->session->cwindow_scrollbars = 0;
+                       gui->zoom_panel->update(0);
+                       zoom = gui->get_auto_zoom();
+               }
+               else {
+                       gui->zoom_panel->ZoomPanel::update(zoom);
+                       float output_x = x, output_y = y;
+                       canvas_to_output(mwindow->edl, 0, output_x, output_y);
+                       x = output_x - x / zoom;
+                       y = output_y - y / zoom;
+               }
        }
-       if( !zoom ) {
-               mwindow->edl->session->cwindow_scrollbars = 0;
-               gui->zoom_panel->update(0);
-               zoom = gui->get_auto_zoom();
+       else {
+               mwindow->edl->session->cwindow_scrollbars = 1;
+               x = (mwindow->edl->session->output_w - w) / 2;
+               y = (mwindow->edl->session->output_h - h) / 2;
+               zoom = 1;
        }
-       else
-               gui->zoom_panel->ZoomPanel::update(zoom);
-
-       float output_x = x, output_y = y;
-       canvas_to_output(mwindow->edl, 0, output_x, output_y);
-       x = output_x - x / zoom;
-       y = output_y - y / zoom;
        update_zoom((int)x, (int)y, zoom);
 
        gui->composite_panel->cpanel_zoom->update(zoom);
index dfd95195c50a08943ffbc730e7f1ab0def0b19c8..5ec33dfd335647b18d3868db7aeeb89d660855c2 100644 (file)
@@ -1,4 +1,4 @@
-cin (1:5.1.20170429) unstable; urgency=low
+cin (1:5.1.20170531) unstable; urgency=low
 
   [ guy goode ]
 
index 9f65e379c29c2fb7cce2c59d130562d664f046e7..f771775a1468fc1220cdce790d280675bb35ac73 100644 (file)
@@ -1,7 +1,7 @@
 Source: cin
 Section: video
 Priority: optional
-Standards-Version: 5.1.20170429
+Standards-Version: 5.1.20170531
 Maintainer: mailing list <[email protected]>
 Homepage: http://www.cinelerra-cv.org/
 Build-Depends: nasm, yasm, g++, gdb, build-essential, e2fsprogs,