2005-03-23 mallum,,, <mallum@openedhand.com>
+ * cltr.c: (ctrl_photo_grid_get_trans_coords),
+ Fix grid co-ords -> translation vals converter
+ (cltr_photo_grid_navigate), (cltr_photo_grid_redraw),
+ (cltr_photo_grid_new), (idle_cb):
+ Fix moving between pictures when zoomed
+
+
+2005-03-23 mallum,,, <mallum@openedhand.com>
+
* cltr.c: (cltr_dispatch_x_event), (cltr_window_new),
(cltr_main_loop), (cltr_photo_grid_navigate),
(cltr_photo_grid_activate_cell), (cltr_photo_grid_populate),
/* XXX figure out what magic 2.0 value comes from */
+ /*
*tx = (float)( (max_x-x) - 1.0 ) * 2.0;
*ty = (float)( y - 1.0 ) * 2.0;
+ */
+
+ /*
+ 3x3 0,0 -> 2,-2
+
+ 5x5 0,0 ->
+ *tx = 4.0;
+ *ty = -4.0;
+ 4x4 0,0 -> 3.0, -3.0
+ */
+
+ /*
+ float trange = ((float)(grid->n_cols - 1.0) * 2.0);
+ float xrange = (float)grid->n_cols - 1.0;
+ */
+
+ /*
+ *tx = ((max_x-x) * (trange/xrange)) - (trange/2);
+ *ty = (y * (trange/xrange)) - (trange/2);
+ */
+
+ /* assumes rows = cols */
+
+ *tx = ((max_x-x) * 2.0) - (grid->n_cols - 1.0);
+ *ty = (y * 2.0) - (grid->n_cols - 1.0);
}
void
if (grid->state == CLTR_PHOTO_GRID_STATE_ZOOMED)
{
grid->state = CLTR_PHOTO_GRID_STATE_ZOOMED_MOVE;
-
- grid->view_min_x = grid->view_max_x;
- grid->view_min_y = grid->view_max_y ;
-
+ grid->view_min_x = grid->view_max_x;
+ grid->view_min_y = grid->view_max_y ;
+ grid->anim_step = 0;
}
ctrl_photo_grid_cell_to_coords(grid, grid->cell_active, &x, &y);
{
float f = (float)grid->anim_step/grid->anim_n_steps;
- trans_x = (grid->view_max_x - grid->view_min_x) * f;
- trans_y = (grid->view_max_y - grid->view_min_y) * f;
+ trans_x = grid->view_min_x + ((grid->view_max_x - grid->view_min_x) * f);
+ trans_y = grid->view_min_y + ((grid->view_max_y - grid->view_min_y) * f);
+
}
}
grid->state = CLTR_PHOTO_GRID_STATE_BROWSE;
- grid->anim_n_steps = 40; /* value needs to be calced dep on rows */
+ grid->anim_n_steps = 50; /* value needs to be calced dep on rows */
grid->anim_step = 0;
/*
{
ClutterPhotoGrid *grid = (ClutterPhotoGrid *)data;
+ /*
+ if (grid->state != CLTR_PHOTO_GRID_STATE_BROWSE
+ && grid->state != CLTR_PHOTO_GRID_STATE_ZOOMED)
+ */
cltr_photo_grid_redraw(grid);
return TRUE;