RSS/Atom feed Twitter
Site is read-only, email is disabled

plugin which will center a layer horizontally and/or vertically

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

plugin which will center a layer horizontally and/or vertically John Minson 21 May 14:35
  plugin which will center a layer horizontally and/or vertically Carol Spears 21 May 16:37
John Minson
2006-05-21 14:35:18 UTC (almost 18 years ago)

plugin which will center a layer horizontally and/or vertically

Here is Joao S. O. Bueno plugin which will center a layer horizontally and/or vertically .
Many thanks to Joao .

#!/usr/bin/env python

from gimpfu import *

# (c) 2004 by Joao S. O. Bueno Calligaris

def center_layer (img, drw, h_center, v_center):

if h_center: x = (img.width - drw.width) / 2 else:
x = drw.offsets[0]
if v_center:
y = (img.height - drw.height) / 2 else:
y = drw.offsets[1]
drw.set_offsets (x, y)
pdb.gimp_displays_flush ()

register( "center_layer",
"Centers Current Layer on Canvas", "enters Current Layer on Canvas", "Joao S. O. Bueno",
"(k) All rites reversed - JS", "2004",
"/Python-Fu/center-layer",
"*",
[
(PF_BOOL, "h_center", "Center Horizontaly", True), (PF_BOOL, "v_center", "Center Vertically", True), ],
[],
center_layer)

main()

Carol Spears
2006-05-21 16:37:46 UTC (almost 18 years ago)

plugin which will center a layer horizontally and/or vertically

On Sun, May 21, 2006 at 07:35:18AM -0500, John Minson wrote:

Here is Joao S. O. Bueno plugin which will center a layer horizontally and/or vertically .
Many thanks to Joao .

register( "center_layer",
"Centers Current Layer on Canvas", "enters Current Layer on Canvas", "Joao S. O. Bueno",
"(k) All rites reversed - JS", "2004",
"/Python-Fu/center-layer",

this line:

"*",

should be this:

"",

[
(PF_BOOL, "h_center", "Center Horizontaly", True), (PF_BOOL, "v_center", "Center Vertically", True), ],
[],
center_layer)

main()