From ab971600673024805d9906b791a1a54043a12855 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 6 Sep 2002 21:09:49 +0000 Subject: Attach hotspot coordinates to the pixbuf as options "x_hot" and "y_hot". * io-xpm.c (pixbuf_create_from_xpm): * io-xbm.c (gdk_pixbuf__xbm_image_load_real): * io-ico.c (DecodeHeader): Attach hotspot coordinates to the pixbuf as options "x_hot" and "y_hot". --- gdk-pixbuf/io-xbm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdk-pixbuf/io-xbm.c') diff --git a/gdk-pixbuf/io-xbm.c b/gdk-pixbuf/io-xbm.c index 71e6e40393..0ec63755be 100644 --- a/gdk-pixbuf/io-xbm.c +++ b/gdk-pixbuf/io-xbm.c @@ -295,6 +295,14 @@ gdk_pixbuf__xbm_image_load_real (FILE *f, XBMData *context, GError **error) return NULL; } + if (x_hot != -1 && y_hot != -1) { + gchar hot[10]; + g_snprintf (hot, 10, "%d", x_hot); + gdk_pixbuf_set_option (pixbuf, "x_hot", hot); + g_snprintf (hot, 10, "%d", y_hot); + gdk_pixbuf_set_option (pixbuf, "y_hot", hot); + } + pixels = gdk_pixbuf_get_pixels (pixbuf); row_stride = gdk_pixbuf_get_rowstride (pixbuf); -- cgit v1.2.1