From fee8a037dc16faf9e58d3f64191b5080593e883e Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:21:05 +0200 Subject: [PATCH] fix position --- internal/pkg/epubtemplates/content.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/pkg/epubtemplates/content.go b/internal/pkg/epubtemplates/content.go index 0075812..f0e1225 100644 --- a/internal/pkg/epubtemplates/content.go +++ b/internal/pkg/epubtemplates/content.go @@ -227,7 +227,7 @@ func (o Content) getSpineAuto() []tag { ) } } - for _, img := range o.Images { + for i, img := range o.Images { if (img.DoublePage || img.Part == 1) && o.ImageOptions.Manga == isOnTheRight { spine = append(spine, tag{ "itemref", @@ -242,6 +242,8 @@ func (o Content) getSpineAuto() []tag { tagAttrs{"idref": img.PageKey(), "properties": img.Position}, "", }) + // save position, img is a value type + o.Images[i] = img } if o.ImageOptions.Manga == isOnTheRight { spine = append(spine, tag{