Commit 6865bb9e authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

Bug 546924 – "New Image" misscalculating dimensions for non-pixel sized

2008-09-30  Michael Natterer  <mitch@gimp.org>

	Bug 546924 – "New Image" misscalculating dimensions for non-pixel
	sized templates

	* app/core/gimptemplate.h: added private param flag
	GIMP_TEMPLATE_PARAM_COPY_FIRST.

	* app/core/gimptemplate.c (gimp_template_class_init): set the flag
	on the resolution properties.

	* app/dialogs/image-new-dialog.c (image_new_template_changed):
	make sure the resolution properties are copied first.

	* libgimpconfig/gimpconfig-utils.c (gimp_config_sync): remove
	comment about fixing the template editor. That's not true any
	more.


svn path=/trunk/; revision=27091
parent 52c61f6b
2008-09-30 Michael Natterer <mitch@gimp.org>
Bug 546924 – "New Image" misscalculating dimensions for non-pixel
sized templates
* app/core/gimptemplate.h: added private param flag
GIMP_TEMPLATE_PARAM_COPY_FIRST.
* app/core/gimptemplate.c (gimp_template_class_init): set the flag
on the resolution properties.
* app/dialogs/image-new-dialog.c (image_new_template_changed):
make sure the resolution properties are copied first.
* libgimpconfig/gimpconfig-utils.c (gimp_config_sync): remove
comment about fixing the template editor. That's not true any
more.
2008-09-30 Michael Natterer <mitch@gimp.org>
* app/tools/gimpimagemaptool.[ch]: keep a "default_config" object
......
......@@ -112,12 +112,14 @@ gimp_template_class_init (GimpTemplateClass *klass)
"xresolution",
N_("The horizontal image resolution."),
DEFAULT_RESOLUTION,
GIMP_PARAM_STATIC_STRINGS);
GIMP_PARAM_STATIC_STRINGS |
GIMP_TEMPLATE_PARAM_COPY_FIRST);
GIMP_CONFIG_INSTALL_PROP_RESOLUTION (object_class, PROP_YRESOLUTION,
"yresolution",
N_("The vertical image resolution."),
DEFAULT_RESOLUTION,
GIMP_PARAM_STATIC_STRINGS);
GIMP_PARAM_STATIC_STRINGS |
GIMP_TEMPLATE_PARAM_COPY_FIRST);
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_RESOLUTION_UNIT,
"resolution-unit",
NULL,
......
......@@ -26,6 +26,8 @@
#include "gimpviewable.h"
#define GIMP_TEMPLATE_PARAM_COPY_FIRST (1 << (8 + G_PARAM_USER_SHIFT))
/* The default image aspect ratio is the golden mean. We use
* two adjacent fibonacci numbers for the unstable series and
* some less odd values for the stable version.
......
......@@ -245,6 +245,9 @@ image_new_template_changed (GimpContext *context,
if (!template->comment || !strlen (template->comment))
comment = g_strdup (dialog->template->comment);
/* make sure the resolution values are copied first (see bug #546924) */
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
GIMP_TEMPLATE_PARAM_COPY_FIRST);
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template), 0);
if (comment)
......
......@@ -206,7 +206,6 @@ gimp_config_sync (GObject *src,
/* we use the internal versions here for a number of reasons:
* - it saves a g_list_reverse()
* - it avoids duplicated parameter checks
* - it makes GimpTemplateEditor work (resolution is set before size)
*/
if (G_TYPE_FROM_INSTANCE (src) == G_TYPE_FROM_INSTANCE (dest))
diff = gimp_config_diff_same (src, dest, (flags | G_PARAM_READWRITE));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment