From 230f4fdce9d4b62d8780702bb406a1f5f629a3c3 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Fri, 7 Dec 2018 12:13:11 -0700 Subject: [PATCH] fix for vframe get_temp blunder, vicon zoom tweak --- cinelerra-5.1/cinelerra/awindowgui.C | 4 ++-- cinelerra-5.1/guicast/vframe.C | 3 ++- cinelerra-5.1/guicast/vicon.C | 21 +++++++++++---------- cinelerra-5.1/guicast/vicon.h | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 072f878e..b370b2c3 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -331,7 +331,7 @@ int AssetViewPopup::button_press_event() int dir = 1, button = get_buttonpress(); switch( button ) { case WHEEL_DOWN: dir = -1; // fall thru - case WHEEL_UP: return zoom_scale(dir); + case WHEEL_UP: return avt->zoom_scale(dir); case LEFT_BUTTON: break; default: @@ -2570,7 +2570,7 @@ int AWindowAssets::button_press_event() case WHEEL_UP: { int x = get_cursor_x(), y = get_cursor_y(); if( avt->cursor_inside(x, y) && avt->view_win ) - return avt->view_win->zoom_scale(dir); + return avt->zoom_scale(dir); return 1; } } } diff --git a/cinelerra-5.1/guicast/vframe.C b/cinelerra-5.1/guicast/vframe.C index 76d6ae1d..63c36f06 100644 --- a/cinelerra-5.1/guicast/vframe.C +++ b/cinelerra-5.1/guicast/vframe.C @@ -390,7 +390,8 @@ int VFrame::get_keyframe() void VFrame::get_temp(VFrame *&vfrm, int w, int h, int color_model) { - if( vfrm && ( vfrm->get_w() != w || vfrm->get_h() != h ) ) { + if( vfrm && ( vfrm->color_model != color_model || + vfrm->get_w() != w || vfrm->get_h() != h ) ) { delete vfrm; vfrm = 0; } if( !vfrm ) vfrm = new VFrame(w, h, color_model, 0); diff --git a/cinelerra-5.1/guicast/vicon.C b/cinelerra-5.1/guicast/vicon.C index dbee56da..f27791f9 100644 --- a/cinelerra-5.1/guicast/vicon.C +++ b/cinelerra-5.1/guicast/vicon.C @@ -220,16 +220,6 @@ ViewPopup *VIconThread::new_view_window() return vwin; } -int ViewPopup::zoom_scale(int dir) -{ - int view_h = vt->view_h + dir*vt->view_h/10 + dir; - bclamp(view_h, 16,512); - vt->view_h = view_h; - vt->view_w = view_h * vt->vw/vt->vh; - vt->stop_viewing(); - return 1; -} - void VIconThread:: reset_images() @@ -289,6 +279,17 @@ update_view() return 1; } +int VIconThread::zoom_scale(int dir) +{ + int view_h = this->view_h; + view_h += dir*view_h/10 + dir; + bclamp(view_h, 16,512); + this->view_h = view_h; + this->view_w = view_h * vw/vh; + stop_viewing(); + return 1; +} + void VIconThread:: draw_images() diff --git a/cinelerra-5.1/guicast/vicon.h b/cinelerra-5.1/guicast/vicon.h index dc4963b9..544e1f96 100644 --- a/cinelerra-5.1/guicast/vicon.h +++ b/cinelerra-5.1/guicast/vicon.h @@ -17,7 +17,6 @@ public: virtual int button_release_event() { return 0; } virtual int cursor_motion_event() { return 0; } virtual void draw_vframe(VFrame *frame); - int zoom_scale(int dir); ViewPopup(VIconThread *vt, int x, int y, int w, int h); ~ViewPopup(); @@ -103,6 +102,7 @@ public: int cursor_inside(int x, int y); void set_drawing_area(int x0, int y0, int x1, int y1); void set_view_popup(VIcon *vicon); + int zoom_scale(int dir); void close_view_popup(); void hide_vicons(int v=1); virtual ViewPopup *new_view_window(); -- 2.26.2