app/text/gimptext.[ch] added back "box-unit" property; it makes sense to

2003-10-26  Sven Neumann  <sven@gimp.org>

	* app/text/gimptext.[ch]
	* app/text/gimptextlayout.c: added back "box-unit" property; it
	makes sense to have an extra unit for it.
This commit is contained in:
Sven Neumann 2003-10-26 12:07:05 +00:00 committed by Sven Neumann
parent 0f33b5c413
commit 142d0725ce
4 changed files with 16 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2003-10-26 Sven Neumann <sven@gimp.org>
* app/text/gimptext.[ch]
* app/text/gimptextlayout.c: added back "box-unit" property; it
makes sense to have an extra unit for it.
2003-10-26 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-deserialize.c

View File

@ -167,7 +167,7 @@ gimp_text_class_init (GimpTextClass *klass)
0);
/*
* We use the name "font-size-unit" for backward compatibility.
* The unit is used for all lengths in the text object.
* The unit is also used for other sizes in the text object.
*/
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_UNIT,
"font-size-unit", NULL,
@ -249,6 +249,10 @@ gimp_text_class_init (GimpTextClass *klass)
"box-height", NULL,
0.0, GIMP_MAX_IMAGE_SIZE, 0.0,
GIMP_PARAM_DEFAULTS);
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_BOX_UNIT,
"box-unit", NULL,
TRUE, FALSE, GIMP_UNIT_PIXEL,
0);
GIMP_CONFIG_INSTALL_PROP_MATRIX2 (object_class, PROP_TRANSFORMATION,
"transformation", NULL,
&identity,
@ -262,12 +266,6 @@ gimp_text_class_init (GimpTextClass *klass)
-G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
GIMP_PARAM_DEFAULTS);
/* "box-unit" existed for a while but was never used; ignore it */
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_BOX_UNIT,
"box-unit", NULL,
TRUE, FALSE, GIMP_UNIT_PIXEL,
GIMP_PARAM_IGNORE);
/* border does only exist to implement the old text API */
param_spec = g_param_spec_int ("border", NULL, NULL,
0, GIMP_MAX_IMAGE_SIZE, 0,
@ -368,7 +366,7 @@ gimp_text_get_property (GObject *object,
case PROP_BOX_HEIGHT:
g_value_set_double (value, text->box_height);
break;
case PROP_BOX_UNIT: /* GIMP_PARAM_IGNORE */
case PROP_BOX_UNIT:
g_value_set_int (value, text->unit);
break;
case PROP_TRANSFORMATION:
@ -460,7 +458,7 @@ gimp_text_set_property (GObject *object,
text->box_height = g_value_get_double (value);
break;
case PROP_BOX_UNIT:
/* ignore */
text->box_unit = g_value_get_int (value);
break;
case PROP_TRANSFORMATION:
matrix = g_value_get_boxed (value);

View File

@ -59,6 +59,7 @@ struct _GimpText
GimpTextBoxMode box_mode;
gdouble box_width;
gdouble box_height;
GimpUnit box_unit;
GimpMatrix2 transformation;
gdouble offset_x;
gdouble offset_y;

View File

@ -197,7 +197,7 @@ gimp_text_layout_new (GimpText *text,
pango_layout_set_width (layout->layout,
gimp_text_layout_pixel_size (image->gimp,
text->box_width,
text->unit,
text->box_unit,
xres));
break;
}
@ -222,7 +222,7 @@ gimp_text_layout_new (GimpText *text,
layout->extents.height =
PANGO_PIXELS (gimp_text_layout_pixel_size (image->gimp,
text->box_height,
text->unit,
text->box_unit,
yres));
break;
}