Fix #10465 ScriptFu marshal color strings correctly

Fix test case.
This commit is contained in:
bootchk 2023-12-19 13:34:57 -05:00 committed by Lloyd Konneker
parent 37c971c08e
commit b1f2f71113
2 changed files with 6 additions and 7 deletions

View File

@ -1156,13 +1156,13 @@ script_fu_marshal_procedure_call (scheme *sc,
if (sc->vptr->is_string (sc->vptr->pair_car (a)))
{
if (! gimp_rgb_parse_css (&color,
sc->vptr->string_value (sc->vptr->pair_car (a)),
-1))
gchar *color_string = sc->vptr->string_value (sc->vptr->pair_car (a));
if (! gimp_rgb_parse_css (&color, color_string, -1))
return script_type_error (sc, "color string", i, proc_name);
gimp_rgb_set_alpha (&color, 1.0);
g_debug ("(%s)", sc->vptr->string_value (sc->vptr->pair_car (a)));
gimp_value_set_rgb (&value, &color);
}
else if (sc->vptr->is_list (sc, sc->vptr->pair_car (a)) &&
sc->vptr->list_length (sc, sc->vptr->pair_car (a)) == 3)

View File

@ -26,11 +26,10 @@
; color
(assert `(gimp-channel-set-color ,testChannel "red"))
; effective
; FIXME, SF is broken, should be red
; effective, getter returns same color: red
(assert `(equal?
(car (gimp-channel-get-color ,testChannel))
'(0 0 0)))
'(255 0 0)))
; opacity
(assert `(gimp-channel-set-opacity ,testChannel 0.7))