plug-ins/script-fu/interp_sliba.c applied a patch from Pedro Gimeno that

2003-04-10  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/interp_sliba.c
	* plug-ins/script-fu/scripts/selection-round.scm: applied a patch
	from Pedro Gimeno that adds the trunc() function to our scheme
	interpreter and fixes bug #109475 the right way.
This commit is contained in:
Sven Neumann
2003-04-10 13:44:37 +00:00
committed by Sven Neumann
parent 2db8367c7d
commit 7cd5ffd756
4 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2003-04-10 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/interp_sliba.c
* plug-ins/script-fu/scripts/selection-round.scm: applied a patch
from Pedro Gimeno that adds the trunc() function to our scheme
interpreter and fixes bug #109475 the right way.
2003-04-10 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am

View File

@ -2386,6 +2386,13 @@ swrite (LISP stream, LISP table, LISP data)
return (NIL);
}
LISP
ltrunc (LISP x)
{
double cx = get_c_double (x);
return (flocons (cx < 0.0 ? ceil (cx) : floor (cx)));
}
LISP
lpow (LISP x, LISP y)
{
@ -2867,6 +2874,7 @@ init_subrs_a (void)
init_subr_4 ("fast-save", fast_save);
init_subr_2 ("fast-load", fast_load);
init_subr_3 ("swrite", swrite);
init_subr_1 ("trunc", ltrunc);
init_subr_2 ("pow", lpow);
init_subr_1 ("exp", lexp);
init_subr_1 ("log", llog);

View File

@ -51,12 +51,9 @@
(gimp-undo-push-group-start image)
(if (> select-width select-height)
(begin
(set! cut-radius (* radius (/ select-height 2)))
(set! ellipse-radius (* radius select-height)))
(begin
(set! cut-radius (* radius (/ select-width 2)))
(set! ellipse-radius (* radius select-width))))
(set! cut-radius (trunc (+ 1 (* radius (/ select-height 2)))))
(set! cut-radius (trunc (+ 1 (* radius (/ select-width 2))))))
(set! ellipse-radius (* cut-radius 2))
(gimp-rect-select image
select-x1
select-y1

View File

@ -2386,6 +2386,13 @@ swrite (LISP stream, LISP table, LISP data)
return (NIL);
}
LISP
ltrunc (LISP x)
{
double cx = get_c_double (x);
return (flocons (cx < 0.0 ? ceil (cx) : floor (cx)));
}
LISP
lpow (LISP x, LISP y)
{
@ -2867,6 +2874,7 @@ init_subrs_a (void)
init_subr_4 ("fast-save", fast_save);
init_subr_2 ("fast-load", fast_load);
init_subr_3 ("swrite", swrite);
init_subr_1 ("trunc", ltrunc);
init_subr_2 ("pow", lpow);
init_subr_1 ("exp", lexp);
init_subr_1 ("log", llog);