about summary refs log tree commit diff stats
path: root/src/local/term.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/local/term.nim')
-rw-r--r--src/local/term.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/local/term.nim b/src/local/term.nim
index 37ec90e1..109c6710 100644
--- a/src/local/term.nim
+++ b/src/local/term.nim
@@ -647,8 +647,11 @@ proc positionImage(term: Terminal; image: CanvasImage; x, y, maxw, maxh: int):
   image.offy = -min(ypx, 0)
   # calculate maximum image size that fits on the screen relative to the image
   # origin (*not* offx/offy)
-  let maxwpx = min(maxw * term.attrs.ppc, term.sixelMaxWidth)
-  let maxhpx = min(maxh * term.attrs.ppl, term.sixelMaxHeight)
+  var maxwpx = maxw * term.attrs.ppc
+  var maxhpx = maxh * term.attrs.ppl
+  if term.imageMode == imSixel:
+    maxwpx = min(maxwpx, term.sixelMaxWidth)
+    maxhpx = min(maxhpx, term.sixelMaxHeight)
   image.dispw = min(int(image.bmp.width) + xpx, maxwpx) - xpx
   image.disph = min(int(image.bmp.height) + ypx, maxhpx) - ypx
   image.damaged = true