Commit ad067c73 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Oops, yesterday's "fix" for #10466 made it even worse :)

2002-02-20  Michael Natterer  <mitch@gimp.org>

	Oops, yesterday's "fix" for #10466 made it even worse :)

	* app/core/gimpdrawable-transform.c: need the 0.5 offset to
	the pixel's center only for INTERPOLATION_NONE, as the LINEAR
	and CUBIC algorithms already know about their errors.

	* app/tools/gimpperspectivetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpsheartool.c: some more s/gint/gdouble/ so the
	tools can detect pointer motions again...
parent 84426ce4
2002-02-20 Michael Natterer <mitch@gimp.org>
Oops, yesterday's "fix" for #10466 made it even worse :)
* app/core/gimpdrawable-transform.c: need the 0.5 offset to
the pixel's center only for INTERPOLATION_NONE, as the LINEAR
and CUBIC algorithms already know about their errors.
* app/tools/gimpperspectivetool.c
* app/tools/gimpscaletool.c
* app/tools/gimpsheartool.c: some more s/gint/gdouble/ so the
tools can detect pointer motions again...
2002-02-19 Sven Neumann <sven@gimp.org>
* plug-ins/common/vinvert.c: applied a patch with some optimizations
......
......@@ -263,9 +263,22 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
(* progress_callback) (ty1, ty2, y, progress_data);
/* set up inverse transform steps */
tx = xinc * (tx1 + 0.5) + m[0][1] * (y + 0.5) + m[0][2];
ty = yinc * (tx1 + 0.5) + m[1][1] * (y + 0.5) + m[1][2];
tw = winc * (tx1 + 0.5) + m[2][1] * (y + 0.5) + m[2][2];
if (interpolation_type == GIMP_INTERPOLATION_NONE)
{
/* need to transform the pixel's center for INTERPOLATION_NONE,
* as we end up at discrete pixel positions and are not aware of
* errors in the algorithm below
*/
tx = xinc * (tx1 + 0.5) + m[0][1] * (y + 0.5) + m[0][2];
ty = yinc * (tx1 + 0.5) + m[1][1] * (y + 0.5) + m[1][2];
tw = winc * (tx1 + 0.5) + m[2][1] * (y + 0.5) + m[2][2];
}
else
{
tx = xinc * tx1 + m[0][1] * y + m[0][2];
ty = yinc * tx1 + m[1][1] * y + m[1][2];
tw = winc * tx1 + m[2][1] * y + m[2][2];
}
d = dest;
......@@ -303,7 +316,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
/* check if any part of our region overlaps the buffer */
if ((itx + 2) >= x1 && (itx - 1) < x2 &&
(ity + 2) >= y1 && (ity - 1) < y2 )
(ity + 2) >= y1 && (ity - 1) < y2)
{
guchar *data;
gint row;
......@@ -396,7 +409,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
* (which runs from itx to itx + 1, same in y)
*/
if ((itx + 1) >= x1 && itx < x2 &&
(ity + 1) >= y1 && ity < y2 )
(ity + 1) >= y1 && ity < y2)
{
guchar *data;
gint row;
......
......@@ -263,9 +263,22 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
(* progress_callback) (ty1, ty2, y, progress_data);
/* set up inverse transform steps */
tx = xinc * (tx1 + 0.5) + m[0][1] * (y + 0.5) + m[0][2];
ty = yinc * (tx1 + 0.5) + m[1][1] * (y + 0.5) + m[1][2];
tw = winc * (tx1 + 0.5) + m[2][1] * (y + 0.5) + m[2][2];
if (interpolation_type == GIMP_INTERPOLATION_NONE)
{
/* need to transform the pixel's center for INTERPOLATION_NONE,
* as we end up at discrete pixel positions and are not aware of
* errors in the algorithm below
*/
tx = xinc * (tx1 + 0.5) + m[0][1] * (y + 0.5) + m[0][2];
ty = yinc * (tx1 + 0.5) + m[1][1] * (y + 0.5) + m[1][2];
tw = winc * (tx1 + 0.5) + m[2][1] * (y + 0.5) + m[2][2];
}
else
{
tx = xinc * tx1 + m[0][1] * y + m[0][2];
ty = yinc * tx1 + m[1][1] * y + m[1][2];
tw = winc * tx1 + m[2][1] * y + m[2][2];
}
d = dest;
......@@ -303,7 +316,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
/* check if any part of our region overlaps the buffer */
if ((itx + 2) >= x1 && (itx - 1) < x2 &&
(ity + 2) >= y1 && (ity - 1) < y2 )
(ity + 2) >= y1 && (ity - 1) < y2)
{
guchar *data;
gint row;
......@@ -396,7 +409,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
* (which runs from itx to itx + 1, same in y)
*/
if ((itx + 1) >= x1 && itx < x2 &&
(ity + 1) >= y1 && ity < y2 )
(ity + 1) >= y1 && ity < y2)
{
guchar *data;
gint row;
......
......@@ -213,7 +213,7 @@ static void
perspective_tool_motion (GimpTransformTool *transform_tool,
GimpDisplay *gdisp)
{
gint diff_x, diff_y;
gdouble diff_x, diff_y;
diff_x = transform_tool->curx - transform_tool->lastx;
diff_y = transform_tool->cury - transform_tool->lasty;
......
......@@ -399,7 +399,7 @@ gimp_scale_tool_motion (GimpTransformTool *transform_tool,
gdouble *y2;
gint w, h;
gint dir_x, dir_y;
gint diff_x, diff_y;
gdouble diff_x, diff_y;
options = (TransformOptions *) GIMP_TOOL (transform_tool)->tool_info->tool_options;
......
......@@ -227,7 +227,7 @@ shear_x_mag_changed (GtkWidget *widget,
{
GimpTool *tool;
GimpTransformTool *transform_tool;
gint value;
gdouble value;
tool = GIMP_TOOL (data);
transform_tool = GIMP_TRANSFORM_TOOL (data);
......@@ -252,7 +252,7 @@ shear_y_mag_changed (GtkWidget *widget,
{
GimpTool *tool;
GimpTransformTool *transform_tool;
gint value;
gdouble value;
tool = GIMP_TOOL (data);
transform_tool = GIMP_TRANSFORM_TOOL (data);
......@@ -275,8 +275,8 @@ static void
shear_tool_motion (GimpTransformTool *transform_tool,
GimpDisplay *gdisp)
{
gint diffx, diffy;
gint dir;
gdouble diffx, diffy;
gint dir;
diffx = transform_tool->curx - transform_tool->lastx;
diffy = transform_tool->cury - transform_tool->lasty;
......
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