Commit 0cdca57d authored by Jehan's avatar Jehan

plug-ins: use an epsilon to compare double values.

Also take into account the case when the minimum possible print
resolution is higher than the expected image resolution. We don't want
to remember the print resolution if it is this lower value either.
See commit 7335dc8d.
parent 3b41d160
......@@ -918,6 +918,8 @@ print_size_info_set_page_setup (PrintSizeInfo *info)
x = y = max;
}
data->min_xres = x;
data->min_yres = y;
gimp_size_entry_set_refval_boundaries (info->resolution_entry, 0,
x, GIMP_MAX_RESOLUTION);
gimp_size_entry_set_refval_boundaries (info->resolution_entry, 1,
......
......@@ -88,7 +88,14 @@ print_settings_save (PrintData *data)
g_key_file_set_integer (key_file, "image-setup",
"unit", data->unit);
if (xres != data->xres || yres != data->yres)
/* Do not save the print resolution when it is the expected image
* resolution so that changing it (i.e. in "print size" dialog)
* is not overrided by any previous prints.
*/
if ((data->min_xres <= xres && ABS (xres - data->xres) > 0.1) ||
(data->min_yres <= yres && ABS (yres - data->yres) > 0.1) ||
(data->min_xres > xres && ABS (data->min_xres - data->xres) > 0.1) ||
(data->min_yres > yres && ABS (data->min_yres - data->yres) > 0.1))
{
g_key_file_set_double (key_file, "image-setup",
"x-resolution", data->xres);
......
......@@ -44,6 +44,8 @@ typedef struct
GimpUnit unit;
gdouble xres;
gdouble yres;
gdouble min_xres;
gdouble min_yres;
GimpUnit image_unit;
gdouble offset_x;
gdouble offset_y;
......
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