mirror of https://github.com/GNOME/gimp.git
avoid modulo operation on negative values.
2000-10-26 Sven Neumann <sven@gimp.org> * app/channel_ops.c (offset_ok_callback): avoid modulo operation on negative values. * app/channel_ops.c * app/crop.c * app/file_new_dialog.c * app/layers_dialog.c * app/preferences_dialog.c * app/rotate_tool.c * app/scale_tool.c: use RINT() when assigning the result of gimp_size_entry_get_refval() to an integer.
This commit is contained in:
parent
cfa2e13571
commit
8cfac64aac
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2000-10-26 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/channel_ops.c (offset_ok_callback): avoid modulo operation on
|
||||
negative values.
|
||||
|
||||
* app/channel_ops.c
|
||||
* app/crop.c
|
||||
* app/file_new_dialog.c
|
||||
* app/layers_dialog.c
|
||||
* app/preferences_dialog.c
|
||||
* app/rotate_tool.c
|
||||
* app/scale_tool.c: use RINT() when assigning the result of
|
||||
gimp_size_entry_get_refval() to an integer.
|
||||
|
||||
Thu Oct 26 10:58:23 PDT 2000 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* INSTALL: clear up use of --prefix
|
||||
|
|
|
@ -228,6 +228,12 @@ offset (GimpImage *gimage,
|
|||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* avoid modulo operation on negative values */
|
||||
while (offset_x < 0)
|
||||
offset_x += width;
|
||||
while (offset_y < 0)
|
||||
offset_y += height;
|
||||
|
||||
offset_x %= width;
|
||||
offset_y %= height;
|
||||
}
|
||||
|
@ -464,9 +470,9 @@ offset_ok_callback (GtkWidget *widget,
|
|||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
offset_x = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
|
||||
offset_y = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1));
|
||||
|
||||
offset (gimage, drawable, off_d->wrap_around, off_d->fill_type,
|
||||
offset_x, offset_y);
|
||||
|
|
|
@ -228,6 +228,12 @@ offset (GimpImage *gimage,
|
|||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* avoid modulo operation on negative values */
|
||||
while (offset_x < 0)
|
||||
offset_x += width;
|
||||
while (offset_y < 0)
|
||||
offset_y += height;
|
||||
|
||||
offset_x %= width;
|
||||
offset_y %= height;
|
||||
}
|
||||
|
@ -464,9 +470,9 @@ offset_ok_callback (GtkWidget *widget,
|
|||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
offset_x = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
|
||||
offset_y = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1));
|
||||
|
||||
offset (gimage, drawable, off_d->wrap_around, off_d->fill_type,
|
||||
offset_x, offset_y);
|
||||
|
|
|
@ -228,6 +228,12 @@ offset (GimpImage *gimage,
|
|||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* avoid modulo operation on negative values */
|
||||
while (offset_x < 0)
|
||||
offset_x += width;
|
||||
while (offset_y < 0)
|
||||
offset_y += height;
|
||||
|
||||
offset_x %= width;
|
||||
offset_y %= height;
|
||||
}
|
||||
|
@ -464,9 +470,9 @@ offset_ok_callback (GtkWidget *widget,
|
|||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
offset_x = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
|
||||
offset_y = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1));
|
||||
|
||||
offset (gimage, drawable, off_d->wrap_around, off_d->fill_type,
|
||||
offset_x, offset_y);
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
@ -32,8 +35,8 @@
|
|||
#include "info_dialog.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define STATUSBAR_SIZE 128
|
||||
|
@ -1512,8 +1515,8 @@ crop_orig_changed (GtkWidget *widget,
|
|||
{
|
||||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
crop = (Crop *) tool->private;
|
||||
ox = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
||||
oy = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
||||
ox = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
oy = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((ox != crop->tx1) ||
|
||||
(oy != crop->ty1))
|
||||
|
|
|
@ -15,13 +15,16 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "file_new_dialog.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpchainbutton.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -65,10 +68,10 @@ file_new_ok_callback (GtkWidget *widget,
|
|||
values = info->values;
|
||||
|
||||
/* get the image size in pixels */
|
||||
values->width = (int)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0) + 0.5);
|
||||
values->height = (int)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1) + 0.5);
|
||||
values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
/* get the resolution in dpi */
|
||||
values->xresolution =
|
||||
|
@ -279,10 +282,10 @@ file_new_image_size_callback (GtkWidget *widget,
|
|||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
info->values->width = (gdouble) (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0) + 0.5);
|
||||
info->values->height = (gdouble) (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1) + 0.5);
|
||||
info->values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
info->values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
info->size = image_new_calculate_size (info->values);
|
||||
|
||||
|
|
|
@ -1069,9 +1069,9 @@ prefs_default_size_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
default_width =
|
||||
(gint) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
default_height =
|
||||
(gint) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
}
|
||||
|
||||
|
@ -1117,13 +1117,16 @@ prefs_default_resolution_callback (GtkWidget *widget,
|
|||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry),
|
||||
1, yres, FALSE);
|
||||
|
||||
default_width = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0) + 0.5);
|
||||
default_height = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1) + 0.5);
|
||||
default_width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0));
|
||||
default_height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1));
|
||||
|
||||
default_xresolution = xres;
|
||||
default_yresolution = yres;
|
||||
default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
|
||||
default_resolution_units =
|
||||
gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -15,13 +15,16 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "file_new_dialog.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpchainbutton.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -65,10 +68,10 @@ file_new_ok_callback (GtkWidget *widget,
|
|||
values = info->values;
|
||||
|
||||
/* get the image size in pixels */
|
||||
values->width = (int)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0) + 0.5);
|
||||
values->height = (int)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1) + 0.5);
|
||||
values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
/* get the resolution in dpi */
|
||||
values->xresolution =
|
||||
|
@ -279,10 +282,10 @@ file_new_image_size_callback (GtkWidget *widget,
|
|||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
info->values->width = (gdouble) (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0) + 0.5);
|
||||
info->values->height = (gdouble) (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1) + 0.5);
|
||||
info->values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
info->values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
info->size = image_new_calculate_size (info->values);
|
||||
|
||||
|
|
|
@ -228,6 +228,12 @@ offset (GimpImage *gimage,
|
|||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* avoid modulo operation on negative values */
|
||||
while (offset_x < 0)
|
||||
offset_x += width;
|
||||
while (offset_y < 0)
|
||||
offset_y += height;
|
||||
|
||||
offset_x %= width;
|
||||
offset_y %= height;
|
||||
}
|
||||
|
@ -464,9 +470,9 @@ offset_ok_callback (GtkWidget *widget,
|
|||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
offset_x = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
|
||||
offset_y = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1));
|
||||
|
||||
offset (gimage, drawable, off_d->wrap_around, off_d->fill_type,
|
||||
offset_x, offset_y);
|
||||
|
|
|
@ -228,6 +228,12 @@ offset (GimpImage *gimage,
|
|||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* avoid modulo operation on negative values */
|
||||
while (offset_x < 0)
|
||||
offset_x += width;
|
||||
while (offset_y < 0)
|
||||
offset_y += height;
|
||||
|
||||
offset_x %= width;
|
||||
offset_y %= height;
|
||||
}
|
||||
|
@ -464,9 +470,9 @@ offset_ok_callback (GtkWidget *widget,
|
|||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
offset_x = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
|
||||
offset_y = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1));
|
||||
|
||||
offset (gimage, drawable, off_d->wrap_around, off_d->fill_type,
|
||||
offset_x, offset_y);
|
||||
|
|
|
@ -15,13 +15,16 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "file_new_dialog.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpchainbutton.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -65,10 +68,10 @@ file_new_ok_callback (GtkWidget *widget,
|
|||
values = info->values;
|
||||
|
||||
/* get the image size in pixels */
|
||||
values->width = (int)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0) + 0.5);
|
||||
values->height = (int)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1) + 0.5);
|
||||
values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
/* get the resolution in dpi */
|
||||
values->xresolution =
|
||||
|
@ -279,10 +282,10 @@ file_new_image_size_callback (GtkWidget *widget,
|
|||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
info->values->width = (gdouble) (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0) + 0.5);
|
||||
info->values->height = (gdouble) (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1) + 0.5);
|
||||
info->values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
info->values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
info->size = image_new_calculate_size (info->values);
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
@ -39,6 +40,7 @@
|
|||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -57,6 +59,7 @@
|
|||
|
||||
#include "layer_pvt.h"
|
||||
|
||||
|
||||
#define LAYER_PREVIEW 0
|
||||
#define MASK_PREVIEW 1
|
||||
#define FS_PREVIEW 2
|
||||
|
@ -3420,10 +3423,10 @@ new_layer_query_ok_callback (GtkWidget *widget,
|
|||
g_free (layer_name);
|
||||
layer_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
||||
|
||||
options->xsize = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 0) + 0.5);
|
||||
options->ysize = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 1) + 0.5);
|
||||
options->xsize =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 0));
|
||||
options->ysize =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 1));
|
||||
|
||||
fill_type = options->fill_type;
|
||||
|
||||
|
|
|
@ -1069,9 +1069,9 @@ prefs_default_size_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
default_width =
|
||||
(gint) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
default_height =
|
||||
(gint) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
}
|
||||
|
||||
|
@ -1117,13 +1117,16 @@ prefs_default_resolution_callback (GtkWidget *widget,
|
|||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry),
|
||||
1, yres, FALSE);
|
||||
|
||||
default_width = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0) + 0.5);
|
||||
default_height = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1) + 0.5);
|
||||
default_width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0));
|
||||
default_height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1));
|
||||
|
||||
default_xresolution = xres;
|
||||
default_yresolution = yres;
|
||||
default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
|
||||
default_resolution_units =
|
||||
gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
@ -39,6 +40,7 @@
|
|||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -57,6 +59,7 @@
|
|||
|
||||
#include "layer_pvt.h"
|
||||
|
||||
|
||||
#define LAYER_PREVIEW 0
|
||||
#define MASK_PREVIEW 1
|
||||
#define FS_PREVIEW 2
|
||||
|
@ -3420,10 +3423,10 @@ new_layer_query_ok_callback (GtkWidget *widget,
|
|||
g_free (layer_name);
|
||||
layer_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
||||
|
||||
options->xsize = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 0) + 0.5);
|
||||
options->ysize = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 1) + 0.5);
|
||||
options->xsize =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 0));
|
||||
options->ysize =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (options->size_se), 1));
|
||||
|
||||
fill_type = options->fill_type;
|
||||
|
||||
|
|
|
@ -1069,9 +1069,9 @@ prefs_default_size_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
default_width =
|
||||
(gint) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
default_height =
|
||||
(gint) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
}
|
||||
|
||||
|
@ -1117,13 +1117,16 @@ prefs_default_resolution_callback (GtkWidget *widget,
|
|||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry),
|
||||
1, yres, FALSE);
|
||||
|
||||
default_width = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0) + 0.5);
|
||||
default_height = (gint)
|
||||
(gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1) + 0.5);
|
||||
default_width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0));
|
||||
default_height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1));
|
||||
|
||||
default_xresolution = xres;
|
||||
default_yresolution = yres;
|
||||
default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
|
||||
default_resolution_units =
|
||||
gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -273,10 +273,8 @@ rotate_center_changed (GtkWidget *widget,
|
|||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
transform_core = (TransformCore *) tool->private;
|
||||
|
||||
cx =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
cy =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
cx = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
cy = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((cx != transform_core->cx) ||
|
||||
(cy != transform_core->cy))
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
@ -27,10 +30,11 @@
|
|||
|
||||
#include "tile_manager_pvt.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* storage for information dialog fields */
|
||||
static gchar orig_width_buf[MAX_INFO_BUF];
|
||||
static gchar orig_height_buf[MAX_INFO_BUF];
|
||||
|
@ -284,10 +288,8 @@ scale_size_changed (GtkWidget *widget,
|
|||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
transform_core = (TransformCore *) tool->private;
|
||||
|
||||
width =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
height =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((width != (transform_core->trans_info[X1] -
|
||||
transform_core->trans_info[X0])) ||
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
@ -32,8 +35,8 @@
|
|||
#include "info_dialog.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define STATUSBAR_SIZE 128
|
||||
|
@ -1512,8 +1515,8 @@ crop_orig_changed (GtkWidget *widget,
|
|||
{
|
||||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
crop = (Crop *) tool->private;
|
||||
ox = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
||||
oy = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
||||
ox = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
oy = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((ox != crop->tx1) ||
|
||||
(oy != crop->ty1))
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
@ -32,8 +35,8 @@
|
|||
#include "info_dialog.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpsizeentry.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define STATUSBAR_SIZE 128
|
||||
|
@ -1512,8 +1515,8 @@ crop_orig_changed (GtkWidget *widget,
|
|||
{
|
||||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
crop = (Crop *) tool->private;
|
||||
ox = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
||||
oy = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
||||
ox = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
oy = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((ox != crop->tx1) ||
|
||||
(oy != crop->ty1))
|
||||
|
|
|
@ -273,10 +273,8 @@ rotate_center_changed (GtkWidget *widget,
|
|||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
transform_core = (TransformCore *) tool->private;
|
||||
|
||||
cx =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
cy =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
cx = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
cy = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((cx != transform_core->cx) ||
|
||||
(cy != transform_core->cy))
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
@ -27,10 +30,11 @@
|
|||
|
||||
#include "tile_manager_pvt.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* storage for information dialog fields */
|
||||
static gchar orig_width_buf[MAX_INFO_BUF];
|
||||
static gchar orig_height_buf[MAX_INFO_BUF];
|
||||
|
@ -284,10 +288,8 @@ scale_size_changed (GtkWidget *widget,
|
|||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
transform_core = (TransformCore *) tool->private;
|
||||
|
||||
width =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
height =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((width != (transform_core->trans_info[X1] -
|
||||
transform_core->trans_info[X0])) ||
|
||||
|
|
|
@ -273,10 +273,8 @@ rotate_center_changed (GtkWidget *widget,
|
|||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
transform_core = (TransformCore *) tool->private;
|
||||
|
||||
cx =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
cy =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
cx = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
cy = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((cx != transform_core->cx) ||
|
||||
(cy != transform_core->cy))
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
@ -27,10 +30,11 @@
|
|||
|
||||
#include "tile_manager_pvt.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* storage for information dialog fields */
|
||||
static gchar orig_width_buf[MAX_INFO_BUF];
|
||||
static gchar orig_height_buf[MAX_INFO_BUF];
|
||||
|
@ -284,10 +288,8 @@ scale_size_changed (GtkWidget *widget,
|
|||
gdisp = (GDisplay *) tool->gdisp_ptr;
|
||||
transform_core = (TransformCore *) tool->private;
|
||||
|
||||
width =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0) + 0.5);
|
||||
height =
|
||||
(int) (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1) + 0.5);
|
||||
width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((width != (transform_core->trans_info[X1] -
|
||||
transform_core->trans_info[X0])) ||
|
||||
|
|
Loading…
Reference in New Issue