[gimp] plug-ins: undeprecate align-layers: no need to use gimp_drawable_get()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: undeprecate align-layers: no need to use gimp_drawable_get()
- Date: Sat, 15 Sep 2012 19:57:08 +0000 (UTC)
commit 654af22c0f7e5421e6f00b7e6b0e7ec1737d2339
Author: Michael Natterer <mitch gimp org>
Date: Sat Sep 15 21:54:42 2012 +0200
plug-ins: undeprecate align-layers: no need to use gimp_drawable_get()
plug-ins/common/align-layers.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/common/align-layers.c b/plug-ins/common/align-layers.c
index 1e2ecf6..f82ad2c 100644
--- a/plug-ins/common/align-layers.c
+++ b/plug-ins/common/align-layers.c
@@ -348,7 +348,8 @@ align_layers_get_align_offsets (gint32 drawable_id,
gint *x,
gint *y)
{
- GimpDrawable *layer = gimp_drawable_get (drawable_id);
+ gint width = gimp_drawable_width (drawable_id);
+ gint height = gimp_drawable_height (drawable_id);
switch (VALS.h_base)
{
@@ -356,10 +357,10 @@ align_layers_get_align_offsets (gint32 drawable_id,
*x = 0;
break;
case H_BASE_CENTER:
- *x = layer->width / 2;
+ *x = width / 2;
break;
case H_BASE_RIGHT:
- *x = layer->width;
+ *x = width;
break;
default:
*x = 0;
@@ -372,17 +373,15 @@ align_layers_get_align_offsets (gint32 drawable_id,
*y = 0;
break;
case V_BASE_CENTER:
- *y = layer->height / 2;
+ *y = height / 2;
break;
case V_BASE_BOTTOM:
- *y = layer->height;
+ *y = height;
break;
default:
*y = 0;
break;
}
-
- gimp_drawable_detach (layer);
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]