Commit 2e943b28 authored by Owen Taylor's avatar Owen Taylor

gtkimage.c: Fixes to expose handler from Rob Browning

testselection.c gtktext.c gtktext.h: Spelling fix: foreward => forward
  from Tom Tromey
                                        -owt
parent d6b0c357
......@@ -127,17 +127,17 @@ static gint
gtk_image_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkImage *image;
GtkMisc *misc;
GdkRectangle area;
gint x, y;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_IMAGE (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
{
GtkImage *image;
GtkMisc *misc;
GdkRectangle area, image_bound, intersection;
gint x, y;
image = GTK_IMAGE (widget);
misc = GTK_MISC (widget);
......@@ -156,20 +156,23 @@ gtk_image_expose (GtkWidget *widget,
gdk_gc_set_clip_origin (widget->style->black_gc, x, y);
}
area = event->area;
if ((area.x < 0) || (area.y < 0))
{
area.x = area.y = 0;
area.width = image->image->width;
area.height = image->image->height;
}
gdk_draw_image (widget->window,
widget->style->black_gc,
image->image,
area.x, area.y, x+area.x, y+area.y,
area.width, area.height);
image_bound.x = x;
image_bound.y = y;
image_bound.width = image->image->width;
image_bound.height = image->image->height;
area = event->area;
if(gdk_rectangle_intersect(&image_bound, &area, &intersection))
{
gdk_draw_image (widget->window,
widget->style->black_gc,
image->image,
image_bound.x - x, image_bound.y - y,
image_bound.x, image_bound.y,
image_bound.width, image_bound.height);
}
if (image->mask)
{
gdk_gc_set_clip_mask (widget->style->black_gc, NULL);
......
......@@ -578,11 +578,11 @@ gtk_text_backward_delete (GtkText *text,
gtk_text_set_point (text, text->point.index - nchars);
return gtk_text_foreward_delete (text, nchars);
return gtk_text_forward_delete (text, nchars);
}
gint
gtk_text_foreward_delete (GtkText *text,
gtk_text_forward_delete (GtkText *text,
guint nchars)
{
g_return_val_if_fail (text != NULL, 0);
......@@ -1080,7 +1080,7 @@ gtk_text_key_press (GtkWidget *widget,
if (!text->has_cursor || LAST_INDEX (text, text->cursor_mark))
break;
gtk_text_foreward_delete (text, 1);
gtk_text_forward_delete (text, 1);
break;
case GDK_Tab:
if (!text->has_cursor)
......
......@@ -192,7 +192,7 @@ void gtk_text_insert (GtkText *text,
gint length);
gint gtk_text_backward_delete (GtkText *text,
guint nchars);
gint gtk_text_foreward_delete (GtkText *text,
gint gtk_text_forward_delete (GtkText *text,
guint nchars);
......
......@@ -282,8 +282,8 @@ selection_received (GtkWidget *widget, GtkSelectionData *data)
gtk_text_freeze (GTK_TEXT (selection_text));
gtk_text_set_point (GTK_TEXT (selection_text), 0);
gtk_text_foreward_delete (GTK_TEXT (selection_text),
gtk_text_get_length (GTK_TEXT (selection_text)));
gtk_text_forward_delete (GTK_TEXT (selection_text),
gtk_text_get_length (GTK_TEXT (selection_text)));
position = 0;
while (position < data->length)
......
......@@ -282,8 +282,8 @@ selection_received (GtkWidget *widget, GtkSelectionData *data)
gtk_text_freeze (GTK_TEXT (selection_text));
gtk_text_set_point (GTK_TEXT (selection_text), 0);
gtk_text_foreward_delete (GTK_TEXT (selection_text),
gtk_text_get_length (GTK_TEXT (selection_text)));
gtk_text_forward_delete (GTK_TEXT (selection_text),
gtk_text_get_length (GTK_TEXT (selection_text)));
position = 0;
while (position < data->length)
......
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