Commit 3233d4cd authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Do world->canvas cordinate conversion to get zoomed resizng working).

1998-07-12  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/item-bar.c (item_bar_event): Do world->canvas cordinate
	conversion to get zoomed resizng working).

	* src/sheet.c (sheet_row_set_height): Silly mistake, add the newly
	created rowinfo to the row array, not the column array.
parent 47cc5b43
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
conversion to get zoomed resizng working).
* src/sheet.c (sheet_row_set_height): Silly mistake, add the newly
created rowinfo to the row array, not the column array.
1998-07-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (style_duplicate): New function. Does style
......
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
conversion to get zoomed resizng working).
* src/sheet.c (sheet_row_set_height): Silly mistake, add the newly
created rowinfo to the row array, not the column array.
1998-07-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (style_duplicate): New function. Does style
......
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
conversion to get zoomed resizng working).
* src/sheet.c (sheet_row_set_height): Silly mistake, add the newly
created rowinfo to the row array, not the column array.
1998-07-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (style_duplicate): New function. Does style
......
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
conversion to get zoomed resizng working).
* src/sheet.c (sheet_row_set_height): Silly mistake, add the newly
created rowinfo to the row array, not the column array.
1998-07-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (style_duplicate): New function. Does style
......
......@@ -225,6 +225,7 @@ is_pointer_on_division (ItemBar *item_bar, int pos, int *the_total, int *the_ele
else
cri = sheet_col_get_info (item_bar->sheet, i);
printf ("%d %d->%d\n", i, cri->pixels, pos);
total += cri->pixels;
if ((total - 4 < pos) && (pos < total + 4)){
if (the_total)
......@@ -286,27 +287,32 @@ item_bar_start_resize (ItemBar *item_bar, int pos)
item_bar->resize_guide = GTK_OBJECT (item);
}
#define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y)
static gint
item_bar_event (GnomeCanvasItem *item, GdkEvent *event)
item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
{
ColRowInfo *cri;
GnomeCanvas *canvas = item->canvas;
ItemBar *item_bar = ITEM_BAR (item);
int pos, start, ele;
int pos, start, ele, x, y;
switch (event->type){
switch (e->type){
case GDK_ENTER_NOTIFY:
convert (canvas, e->crossing.x, e->crossing.y, &x, &y);
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL)
pos = event->crossing.y;
pos = y;
else
pos = event->crossing.x;
pos = x;
set_cursor (item_bar, pos);
break;
case GDK_MOTION_NOTIFY:
convert (canvas, e->motion.x, e->motion.y, &x, &y);
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL)
pos = event->motion.y;
pos = y;
else
pos = event->motion.x;
pos = x;
/* Do column resizing or incremental marking */
if (ITEM_BAR_RESIZING (item_bar)){
......@@ -325,10 +331,11 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *event)
break;
case GDK_BUTTON_PRESS:
convert (canvas, e->button.x, e->button.y, &x, &y);
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL)
pos = event->button.y;
pos = y;
else
pos = event->button.x;
pos = x;
cri = is_pointer_on_division (item_bar, pos, &start, &ele);
if (cri){
......
......@@ -304,8 +304,7 @@ colrow_set_units (Sheet *sheet,ColRowInfo *info)
double pix = sheet->last_zoom_factor_used;
info->units = (info->pixels -
(info->margin_a + info->margin_b + 1))
/ pix;
(info->margin_a + info->margin_b + 1)) / pix;
}
void
......@@ -324,7 +323,8 @@ sheet_row_set_height (Sheet *sheet, int row, int height)
ri->pixels = height;
colrow_set_units (sheet, ri);
if (add)
sheet_col_add (sheet, ri);
sheet_row_add (sheet, ri);
printf ("ROW=%d %d\n", ri->pos, ri->pixels);
sheet_redraw_all (sheet);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment