script-fu: Fix background color in Round Corners

When we call (gimp-context-set-defaults) in the
Round Corners script, we reset the background color
in addition to temporarily clearing out the other
context settings. This results in us always using the
default white background color for the "Add background"
toggle.
This patch saves the background color beforehand and
restores it before creating the background layer, so we
still use the user's preferred color for this layer.
This commit is contained in:
Alx Sa 2026-02-09 16:18:01 +00:00
parent 885c07555d
commit ec1dfb2e0c

View file

@ -59,10 +59,12 @@
; active drawable is not necessarily the active layer
(pic-layer (vector-ref (car (gimp-image-get-selected-layers image)) 0))
(type (car (gimp-drawable-type-with-alpha pic-layer)))
(background-color (car (gimp-context-get-background)))
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-context-set-background background-color)
(if (= work-on-copy TRUE)
(gimp-image-undo-disable image)