mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-19 15:51:40 +00:00
made emblems draw properly in anti-aliased mode
made emblems draw properly in anti-aliased mode
This commit is contained in:
parent
08a71e320f
commit
04bcb0220e
|
@ -1,3 +1,9 @@
|
|||
2000-05-23 Andy Hertzfeld <andy@eazel.com>
|
||||
|
||||
* libnautilus-extensions/nautilus-icon-canvas-item.c:
|
||||
(draw_pixbuf_aa), (nautilus_icon_canvas_item_render):
|
||||
made emblems draw properly in anti-aliased mode
|
||||
|
||||
2000-05-23 John Sullivan <sullivan@eazel.com>
|
||||
|
||||
Some pieces of the application and component-choosing UI.
|
||||
|
|
|
@ -929,9 +929,10 @@ draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y)
|
|||
}
|
||||
|
||||
static void
|
||||
draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x, int y)
|
||||
draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x_offset, int y_offset)
|
||||
{
|
||||
/* FIXME: must take x,y into account in affine */
|
||||
affine[4] += x_offset;
|
||||
affine[5] += y_offset;
|
||||
|
||||
if (gdk_pixbuf_get_has_alpha(pixbuf))
|
||||
art_rgb_rgba_affine (buf->buf,
|
||||
|
@ -953,6 +954,8 @@ draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x,
|
|||
affine,
|
||||
ART_FILTER_NEAREST,
|
||||
NULL);
|
||||
affine[4] -= x_offset;
|
||||
affine[5] -= y_offset;
|
||||
}
|
||||
|
||||
/* shared code to highlight or dim the passed-in pixbuf */
|
||||
|
@ -1077,9 +1080,12 @@ nautilus_icon_canvas_item_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
|
|||
gdk_pixbuf_unref(temp_pixbuf);
|
||||
|
||||
/* draw the emblems */
|
||||
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
||||
|
||||
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
|
||||
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
|
||||
draw_pixbuf_aa (emblem_pixbuf, buf, i2c, emblem_rect.x0, emblem_rect.y0);
|
||||
draw_pixbuf_aa (emblem_pixbuf, buf, i2c, emblem_rect.x0 - icon_rect.x0,
|
||||
emblem_rect.y0 - icon_rect.y0);
|
||||
}
|
||||
|
||||
/* draw the stretch handles */
|
||||
|
|
|
@ -929,9 +929,10 @@ draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y)
|
|||
}
|
||||
|
||||
static void
|
||||
draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x, int y)
|
||||
draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x_offset, int y_offset)
|
||||
{
|
||||
/* FIXME: must take x,y into account in affine */
|
||||
affine[4] += x_offset;
|
||||
affine[5] += y_offset;
|
||||
|
||||
if (gdk_pixbuf_get_has_alpha(pixbuf))
|
||||
art_rgb_rgba_affine (buf->buf,
|
||||
|
@ -953,6 +954,8 @@ draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x,
|
|||
affine,
|
||||
ART_FILTER_NEAREST,
|
||||
NULL);
|
||||
affine[4] -= x_offset;
|
||||
affine[5] -= y_offset;
|
||||
}
|
||||
|
||||
/* shared code to highlight or dim the passed-in pixbuf */
|
||||
|
@ -1077,9 +1080,12 @@ nautilus_icon_canvas_item_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
|
|||
gdk_pixbuf_unref(temp_pixbuf);
|
||||
|
||||
/* draw the emblems */
|
||||
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
||||
|
||||
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
|
||||
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
|
||||
draw_pixbuf_aa (emblem_pixbuf, buf, i2c, emblem_rect.x0, emblem_rect.y0);
|
||||
draw_pixbuf_aa (emblem_pixbuf, buf, i2c, emblem_rect.x0 - icon_rect.x0,
|
||||
emblem_rect.y0 - icon_rect.y0);
|
||||
}
|
||||
|
||||
/* draw the stretch handles */
|
||||
|
|
Loading…
Reference in a new issue