]> git.neil.brown.name Git - edlib.git/commitdiff
render: disable background images for text displays
authorNeilBrown <neil@brown.name>
Sun, 7 May 2023 05:40:35 +0000 (15:40 +1000)
committerNeilBrown <neil@brown.name>
Sat, 20 May 2023 00:10:49 +0000 (10:10 +1000)
If scale:M isn't set, then we cannot usefully do background images, so
don't even try.

Signed-off-by: NeilBrown <neil@brown.name>
python/render-present.py

index 18d8b61a3cb83d91555cc66407c02e22e81deaef..2b7b766ba3da70cfde17b48c25b6973cf345b914 100644 (file)
@@ -455,17 +455,18 @@ class PresenterPane(edlib.Pane):
 
     def handle_present_bg(self, key, focus, mark, **a):
         "handle-prefix:Present-BG:"
+        s = self["scale:M"]
         cmds = key[11:].split(',')
         ret = 0
         for c in cmds:
             rv = None
             if c[:6] == 'color:':
                 rv = focus.call('Draw:clear', 'bg:' + c[6:])
-            if c[:14] == "image-stretch:":
+            if s and c[:14] == "image-stretch:":
                 rv = focus.call('Draw:image', 16, "file:" + self.pathto(c[14:]))
-            if c[:6] == "image:":
+            if s and c[:6] == "image:":
                 rv = focus.call('Draw:image', 4+1, "file:" + self.pathto(c[6:])) # centre
-            if c[:8] == "overlay:":
+            if s and c[:8] == "overlay:":
                 rv = focus.call('Draw:image', 0+2, "file:" + self.pathto(c[8:])) # top right
             if c == "page-local":
                 page = self.find_pages(mark)