Commit 2a3fac83 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

reimplemented without using a logarithm.

2007-06-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimpprojection.c (gimp_projection_get_level):
	reimplemented without using a logarithm.

svn path=/trunk/; revision=22734
parent 1c119489
2007-06-07 Sven Neumann <sven@gimp.org>
* app/core/gimpprojection.c (gimp_projection_get_level):
reimplemented without using a logarithm.
2007-06-07 Sven Neumann <sven@gimp.org>
 
* app/dialogs/Makefile.am
......@@ -20,8 +20,6 @@
#include <glib-object.h>
#include "libgimpmath/gimpmath.h"
#include "core-types.h"
#include "base/tile.h"
......@@ -362,14 +360,22 @@ gimp_projection_get_level (GimpProjection *proj,
gdouble scale_y)
{
gdouble scale;
gdouble next = 1.0;
gint level;
g_return_val_if_fail (GIMP_IS_PROJECTION (proj), PYRAMID_BASE_LEVEL);
scale = MAX (scale_x, scale_y);
level = -(log (scale) / G_LN2);
return CLAMP (level, PYRAMID_BASE_LEVEL, proj->top_level);
for (level = PYRAMID_BASE_LEVEL; level < proj->top_level; level++)
{
next /= 2;
if (next < scale)
break;
}
return level;
}
GimpImage *
......@@ -752,15 +758,11 @@ gimp_projection_paint_area (GimpProjection *proj,
y1 = CLAMP (y, 0, proj->image->height);
x2 = CLAMP (x + w, 0, proj->image->width);
y2 = CLAMP (y + h, 0, proj->image->height);
x = x1;
y = y1;
w = (x2 - x1);
h = (y2 - y1);
gimp_projection_invalidate (proj, x, y, w, h);
gimp_projection_invalidate (proj, x1, y1, x2 - x1, y2 - y1);
g_signal_emit (proj, projection_signals[UPDATE], 0,
now, x, y, w, h);
now, x1, y1, x2 - x1, y2 - y1);
}
static void
......
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