plug-ins: Fix GeglColor port of palette-offset

Removes an index that was needed to GimpRGB, but no longer
valid now that gimp_palette_entry_get_color () returns a GeglColor
object. Also, fixed an issue in Interactive Mode where the first
valid palette would be used for every other attempt, no matter which
palette you clicked on.
This commit is contained in:
Alx Sa 2024-04-18 04:02:48 +00:00
parent dbbdbb45e1
commit 403af1880f

View file

@ -155,7 +155,7 @@ class PaletteOffset (Gimp.PlugIn):
return procedure.new_return_values(Gimp.PDBStatusType.CANCEL,
GLib.Error("Canceled"))
amount = self.get_property("amount")
config.set_property("amount", amount)
config.set_property("palette", None)
#If palette is read only, work on a copy:
editable = palette.is_editable()
@ -166,7 +166,7 @@ class PaletteOffset (Gimp.PlugIn):
tmp_entry_array = []
for i in range (num_colors):
tmp_entry_array.append ((palette.entry_get_name(i)[1],
palette.entry_get_color(i)[1]))
palette.entry_get_color(i)))
for i in range (num_colors):
target_index = i + amount
if target_index >= num_colors: