diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-09-06 21:09:49 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-09-06 21:09:49 +0000 |
commit | ab971600673024805d9906b791a1a54043a12855 (patch) | |
tree | e0c554185e26d52b289a68bddc878108bc6742ef /gdk-pixbuf/io-xbm.c | |
parent | 7830d701ce5b4143b3d9466bd1b9b7bc7484c455 (diff) | |
download | gtk+-ab971600673024805d9906b791a1a54043a12855.tar.gz |
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".
Diffstat (limited to 'gdk-pixbuf/io-xbm.c')
-rw-r--r-- | gdk-pixbuf/io-xbm.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |