From 65bfd700f9b57c71443dac32520c8e2c5565daf5 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 11 Jan 2000 21:23:38 +0000 Subject: [PATCH] in layer_new_from_tiles check if image_type has alpha to avoid obscure * app/layer.c: in layer_new_from_tiles check if image_type has alpha to avoid obscure bugs if the function is not called correctly * app/text_tool_cmds.c * tools/pdbgen/pdb/text_tool.pdb: added a hint about using border = -1 to suppress cropping of empty spaces around the text --Sven --- ChangeLog | 9 +++++++++ app/core/gimplayer.c | 3 +++ app/gimplayer.c | 3 +++ app/layer.c | 3 +++ app/text_tool_cmds.c | 5 +++-- tools/pdbgen/pdb/text_tool.pdb | 7 +++++-- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c246122839..13c779a123 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Jan 11 23:50:53 CET 2000 Sven Neumann + + * app/layer.c: in layer_new_from_tiles check if image_type has alpha + to avoid obscure bugs if the function is not called correctly + + * app/text_tool_cmds.c + * tools/pdbgen/pdb/text_tool.pdb: added a hint about using border = -1 + to suppress cropping of empty spaces around the text + Tue Jan 11 14:36:55 PST 2000 Manish Singh * libgimp/gimpcompat.h: let's not be redundant redundant. Made diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 5ebd13c747..4342f187f5 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -411,6 +411,9 @@ layer_new_from_tiles (GimpImage *gimage, /* If no image or no tile manager, return NULL */ if (!gimage || !tiles ) return NULL; + + /* the layer_type needs to have alpha */ + g_return_val_if_fail (TYPE_HAS_ALPHA (layer_type), NULL); /* Create the new layer */ new_layer = layer_new (0, tiles->width, tiles->height, diff --git a/app/gimplayer.c b/app/gimplayer.c index 5ebd13c747..4342f187f5 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -411,6 +411,9 @@ layer_new_from_tiles (GimpImage *gimage, /* If no image or no tile manager, return NULL */ if (!gimage || !tiles ) return NULL; + + /* the layer_type needs to have alpha */ + g_return_val_if_fail (TYPE_HAS_ALPHA (layer_type), NULL); /* Create the new layer */ new_layer = layer_new (0, tiles->width, tiles->height, diff --git a/app/layer.c b/app/layer.c index 5ebd13c747..4342f187f5 100644 --- a/app/layer.c +++ b/app/layer.c @@ -411,6 +411,9 @@ layer_new_from_tiles (GimpImage *gimage, /* If no image or no tile manager, return NULL */ if (!gimage || !tiles ) return NULL; + + /* the layer_type needs to have alpha */ + g_return_val_if_fail (TYPE_HAS_ALPHA (layer_type), NULL); /* Create the new layer */ new_layer = layer_new (0, tiles->width, tiles->height, diff --git a/app/text_tool_cmds.c b/app/text_tool_cmds.c index 849b77023e..c923c42454 100644 --- a/app/text_tool_cmds.c +++ b/app/text_tool_cmds.c @@ -310,7 +310,8 @@ static ProcRecord text_fontname_proc = { "gimp_text_fontname", "Add text at the specified location as a floating selection or a new layer.", - "This tool requires font information as a fontname conforming to the 'X Logical Font Description Conventions'. You can specify the fontsize in units of pixels or points, and the appropriate metric is specified using the size_type argument. The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the antialias parameter is non-zero, the generated text will blend more smoothly with underlying layers. This option requires more time and memory to compute than non-antialiased text; the resulting floating selection or layer, however, will require the same amount of memory with or without antialiasing. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final rendered text. The border is measured in pixels.", + "This tool requires font information as a fontname conforming to the 'X Logical Font Description Conventions'. You can specify the fontsize in units of pixels or points, and the appropriate metric is specified using the size_type argument. The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the antialias parameter is non-zero, the generated text will blend more smoothly with underlying layers. This option requires more time and memory to compute than non-antialiased text; the resulting floating selection or layer, however, will require the same amount of memory with or without antialiasing. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final rendered text. The border is measured in pixels. If the" + "border is specified as -1, empty spaces around the text will not be cropped.", "Martin Edlman & Sven Neumann", "Spencer Kimball & Peter Mattis", "1998", @@ -613,7 +614,7 @@ static ProcRecord text_proc = "gimp_text", "Add text at the specified location as a floating selection or a new layer.", "This tool requires font information in the form of nine parameters: size, foundry, family, weight, slant, set_width, spacing, registry, encoding. The font size can either be specified in units of pixels or points, and the appropriate metric is specified using the size_type argument. The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the antialias parameter is non-zero, the generated text will blend more smoothly with underlying layers. This option requires more time and memory to compute than non-antialiased text; the resulting floating selection or layer, however, will require the same amount of memory with or without antialiasing. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final rendered text." - "The border is measured in pixels.", + "The border is measured in pixels. If the border is specified as -1, empty spaces around the text will not be cropped.", "Martin Edlman", "Spencer Kimball & Peter Mattis", "1998", diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index 1b142f73b2..cddc286cc7 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -113,7 +113,9 @@ will require the same amount of memory with or without antialiasing. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified -around the final rendered text. The border is measured in pixels. +around the final rendered text. The border is measured in pixels. If the +border is specified as -1, empty spaces around the text will not be cropped. + HELP &pdb_misc; @@ -203,7 +205,8 @@ amount of memory with or without antialiasing. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final -rendered text. The border is measured in pixels. +rendered text. The border is measured in pixels. If the border is specified +as -1, empty spaces around the text will not be cropped. HELP &pdb_misc;