diff --git a/storage.go b/storage.go index 656530f..711f81a 100644 --- a/storage.go +++ b/storage.go @@ -129,7 +129,8 @@ func (s *Storage) Save(capture *SketchCapture) (string, error) { layerPng := filepath.Join(path, "data", filename) rl.ExportImage(*layerTools.capture, layerPng) opacity := float32(layerTools.config.a) / 255.0 - oraLayers[i] = + ii := len(capture.layerTools) - 1 - i + oraLayers[ii] = ora.ORALayer{ Name: layerTools.name, Filename: filename, @@ -137,9 +138,8 @@ func (s *Storage) Save(capture *SketchCapture) (string, error) { Opacity: opacity, Blend: "svg:src-over", } - } - + oraPath := filepath.Join(path, fmt.Sprintf("%s-layers.ora", flakeId)) ora.WriteORA(oraPath, int(capture.width), int(capture.height), oraLayers,