[nautilus] Fix emblem scaling with zoom >= 150%
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Fix emblem scaling with zoom >= 150%
- Date: Wed, 7 Apr 2010 07:59:51 +0000 (UTC)
commit 305cf9768bd716ba9bbcd3e773511536243a9cc5
Author: Marcus Carlson <marcus mejlamej nu>
Date: Wed Apr 7 09:58:04 2010 +0200
Fix emblem scaling with zoom >= 150%
Emblem handling did not properly take zoom into account (#343540)
libnautilus-private/nautilus-icon-canvas-item.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c
index 0e08d31..8c8de44 100644
--- a/libnautilus-private/nautilus-icon-canvas-item.c
+++ b/libnautilus-private/nautilus-icon-canvas-item.c
@@ -2488,7 +2488,7 @@ static void
nautilus_icon_canvas_item_ensure_bounds_up_to_date (NautilusIconCanvasItem *icon_item)
{
NautilusIconCanvasItemDetails *details;
- EelIRect icon_rect, emblem_rect;
+ EelIRect icon_rect, emblem_rect, icon_rect_raw;
EelIRect text_rect, text_rect_for_layout, text_rect_for_entire_text;
EelIRect total_rect, total_rect_for_layout, total_rect_for_entire_text;
EelCanvasItem *item;
@@ -2505,15 +2505,21 @@ nautilus_icon_canvas_item_ensure_bounds_up_to_date (NautilusIconCanvasItem *icon
pixels_per_unit = EEL_CANVAS_ITEM (item)->canvas->pixels_per_unit;
- /* Compute icon rectangle. */
+ /* Compute raw and scaled icon rectangle. */
icon_rect.x0 = 0;
icon_rect.y0 = 0;
+ icon_rect_raw.x0 = 0;
+ icon_rect_raw.y0 = 0;
if (details->pixbuf == NULL) {
icon_rect.x1 = icon_rect.x0;
icon_rect.y1 = icon_rect.y0;
+ icon_rect_raw.x1 = icon_rect_raw.x0;
+ icon_rect_raw.y1 = icon_rect_raw.y0;
} else {
- icon_rect.x1 = icon_rect.x0 + gdk_pixbuf_get_width (details->pixbuf) / pixels_per_unit;
- icon_rect.y1 = icon_rect.y0 + gdk_pixbuf_get_height (details->pixbuf) / pixels_per_unit;
+ icon_rect_raw.x1 = icon_rect_raw.x0 + gdk_pixbuf_get_width (details->pixbuf);
+ icon_rect_raw.y1 = icon_rect_raw.y0 + gdk_pixbuf_get_height (details->pixbuf);
+ icon_rect.x1 = icon_rect_raw.x1 / pixels_per_unit;
+ icon_rect.y1 = icon_rect_raw.y1 / pixels_per_unit;
}
/* Compute text rectangle. */
@@ -2527,7 +2533,7 @@ nautilus_icon_canvas_item_ensure_bounds_up_to_date (NautilusIconCanvasItem *icon
eel_irect_union (&total_rect, &icon_rect, &text_rect);
eel_irect_union (&total_rect_for_layout, &icon_rect, &text_rect_for_layout);
eel_irect_union (&total_rect_for_entire_text, &icon_rect, &text_rect_for_entire_text);
- emblem_layout_reset (&emblem_layout, icon_item, icon_rect, is_rtl);
+ emblem_layout_reset (&emblem_layout, icon_item, icon_rect_raw, is_rtl);
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect, is_rtl)) {
emblem_rect.x0 = floor (emblem_rect.x0 / pixels_per_unit);
emblem_rect.y0 = floor (emblem_rect.y0 / pixels_per_unit);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]