From c0fff8a385e50ad0eae0d4e5ae1d7e5c6a2ef2ae Mon Sep 17 00:00:00 2001 From: Andy Hertzfeld Date: Thu, 5 Apr 2001 20:02:09 +0000 Subject: improved the note sizing, by actually measuring the text and adjusting for * libnautilus-extensions/nautilus-canvas-note-item.c: (nautilus_canvas_note_item_set_note_text), (draw_item_aa_text), (nautilus_canvas_note_item_draw): improved the note sizing, by actually measuring the text and adjusting for the canvas scale factor. * libnautilus-extensions/nautilus-icon-canvas-item.c: (hit_test): made hit-testing prefer emblems when they overlap the icon, since they're visually on top. --- libnautilus-private/nautilus-icon-canvas-item.c | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'libnautilus-private/nautilus-icon-canvas-item.c') diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c index 66f13046a..faa783016 100644 --- a/libnautilus-private/nautilus-icon-canvas-item.c +++ b/libnautilus-private/nautilus-icon-canvas-item.c @@ -2129,6 +2129,21 @@ hit_test (NautilusIconCanvasItem *icon_item, const ArtIRect *canvas_rect, HitTyp /* Check for hit in the icon. If we're highlighted for dropping, anywhere in the rect is OK */ get_icon_canvas_rectangle (icon_item, &icon_rect); + + /* Check for hit in the emblem pixbufs first, since they appear on top of the icon. */ + emblem_layout_reset (&emblem_layout, icon_item, &icon_item->details->canvas_rect); + while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) { + if (hit_test_pixbuf (emblem_pixbuf, &emblem_rect, canvas_rect)) { + if (hit_type != NULL) { + *hit_type = EMBLEM_HIT; + } + if (hit_index != NULL) { + *hit_index = emblem_layout.index; + } + return TRUE; + } + } + if (hit_type != NULL) { *hit_type = ICON_HIT; } @@ -2152,20 +2167,6 @@ hit_test (NautilusIconCanvasItem *icon_item, const ArtIRect *canvas_rect, HitTyp return TRUE; } - /* Check for hit in the emblem pixbufs. */ - emblem_layout_reset (&emblem_layout, icon_item, &icon_item->details->canvas_rect); - while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) { - if (hit_test_pixbuf (emblem_pixbuf, &emblem_rect, canvas_rect)) { - if (hit_type != NULL) { - *hit_type = EMBLEM_HIT; - } - if (hit_index != NULL) { - *hit_index = emblem_layout.index; - } - return TRUE; - } - } - /* there wasn't a hit, so indicate that */ if (hit_type != NULL) { *hit_type = NO_HIT; -- cgit v1.2.1