From 1889f554d76c036c8fcf4ae591ed7077e65efe53 Mon Sep 17 00:00:00 2001 From: lloyd konneker Date: Sun, 13 Oct 2024 14:24:40 -0400 Subject: [PATCH] ScriptFu: scripts: revert changes to SF-TOGGLE args Prior commits porting these scripts to v3 dialect incorrectly compared SF-TOGGLE args to #t and #f. They are bound to TRUE and FALSE, 1 and 0, before choice of dialect can take effect. --- plug-ins/script-fu/scripts/chrome-it.scm | 3 ++- plug-ins/script-fu/scripts/coffee.scm | 3 ++- plug-ins/script-fu/scripts/test-sphere-v3.scm | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plug-ins/script-fu/scripts/chrome-it.scm b/plug-ins/script-fu/scripts/chrome-it.scm index dcc51db793..b75820043e 100644 --- a/plug-ins/script-fu/scripts/chrome-it.scm +++ b/plug-ins/script-fu/scripts/chrome-it.scm @@ -181,7 +181,8 @@ (gimp-floating-sel-anchor floating-sel) ) - (if (not carve-white) + ; carve-white is 0 or 1, not #f or #t + (if (= carve-white TRUE) (gimp-drawable-invert mask #f)) (gimp-context-set-background '(255 255 255)) diff --git a/plug-ins/script-fu/scripts/coffee.scm b/plug-ins/script-fu/scripts/coffee.scm index 7a9f590b40..0d31007824 100644 --- a/plug-ins/script-fu/scripts/coffee.scm +++ b/plug-ins/script-fu/scripts/coffee.scm @@ -40,7 +40,8 @@ (set! theNumber (- theNumber 1)) (set! theStain (gimp-layer-new theImage theSize theSize RGBA-IMAGE _"Stain" 100 - (if inDark + ; inDark is [0, 1] not [#f, #t] + (if (= inDark TRUE) LAYER-MODE-DARKEN-ONLY LAYER-MODE-NORMAL))) diff --git a/plug-ins/script-fu/scripts/test-sphere-v3.scm b/plug-ins/script-fu/scripts/test-sphere-v3.scm index 3af0988794..20e19b9df3 100644 --- a/plug-ins/script-fu/scripts/test-sphere-v3.scm +++ b/plug-ins/script-fu/scripts/test-sphere-v3.scm @@ -80,8 +80,8 @@ (if (and (or (and (>= light 45) (<= light 75)) (and (<= light 135) (>= light 105))) - ; v3 >>> conditional doesn't need (= shadow TRUE) - shadow ) + ; v3 >>> a SF-TOGGLE arg is still [0, 1], not [#f, #t] + (= shadow TRUE)) (let ((shadow-w (* (* radius 2.5) (cos (+ *pi* radians)))) (shadow-h (* radius 0.5)) (shadow-x cx)