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:
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; }
}
}
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);
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()
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()
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();
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();