From f3b79525974ed27fd174bd37e6e17da8421d7ecf Mon Sep 17 00:00:00 2001
From: Matthew Hague <matthew.hague@rhul.ac.uk>
Date: Mon, 11 Oct 2021 18:09:26 +0100
Subject: [PATCH] Fix bookmarking bug with position cloning

After retrieving a bookmarked position, it was being set as the current
position and updated as the slides moved.
---
 lib/slide_helper.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/slide_helper.rb b/lib/slide_helper.rb
index a0ac656..3ba1b2a 100644
--- a/lib/slide_helper.rb
+++ b/lib/slide_helper.rb
@@ -132,6 +132,10 @@ module SlideHelper
             @next_mov_scale = 1
             @next_slide_scale = 1
         end
+
+        def to_s
+          "x = #{@x}, y = #{@y}"
+        end
     end
 
     @@pos = SlidePosition.new
@@ -257,12 +261,13 @@ module SlideHelper
     end
 
     def impress_bookmark(args)
+      puts "Bookmark #{args} #{@@pos}"
       @@bookmarks[args] = @@pos.clone
       ''
     end
 
     def impress_goto(args)
-        @@pos = @@bookmarks[args]
+        @@pos = @@bookmarks[args].clone
         "!SLIDE unclickable x=#{@@pos.x} y=#{@@pos.y} scale=#{@@pos.slide_scale} #{args}"
     end
 
-- 
GitLab