summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-07-14 02:06:00 +0200
committerhut <hut@lepus.uberspace.de>2015-07-14 02:06:00 +0200
commit2e5de116ba257d6a1dd3be2c0061640aa27c6648 (patch)
treebcdf392aa3006f3ba849b8ca0c5362000120f562
parent738385757680d17a33557a5ff8779cb7314097b2 (diff)
parentbe22869e4e5b915d80186928ff22cca4a6f2309c (diff)
downloadranger-2e5de116ba257d6a1dd3be2c0061640aa27c6648.tar.gz
Merge branch 'dev' of https://github.com/ssh0/ranger
-rw-r--r--ranger/ext/img_display.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index 6af717b5..d0a371f4 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -75,10 +75,12 @@ class W3MImageDisplayer(ImageDisplayer):
         fontw, fonth = _get_font_dimensions()
 
         cmd = "6;{x};{y};{w};{h}\n4;\n3;\n".format(
-                x = start_x * fontw,
+                x = int((start_x - 0.2) * fontw),
                 y = start_y * fonth,
-                w = (width + 1) * fontw,
-                h = height * fonth)
+                # y = int((start_y + 1) * fonth), # (for tmux top status bar)
+                w = int((width + 0.4) * fontw),
+                h = height * fonth + 1)
+                # h = (height - 1) * fonth + 1) # (for tmux top status bar)
 
         self.process.stdin.write(cmd)
         self.process.stdin.flush()
@@ -95,7 +97,9 @@ class W3MImageDisplayer(ImageDisplayer):
             raise ImgDisplayUnsupportedException()
 
         max_width_pixels = max_width * fontw
-        max_height_pixels = max_height * fonth
+        max_height_pixels = max_height * fonth - 2
+        # (for tmux top status bar)
+        # max_height_pixels = (max_height - 1) * fonth - 2
 
         # get image size
         cmd = "5;{}\n".format(path)
@@ -119,8 +123,9 @@ class W3MImageDisplayer(ImageDisplayer):
             height = max_height_pixels
 
         return "0;1;{x};{y};{w};{h};;;;;{filename}\n4;\n3;\n".format(
-                x = start_x * fontw,
+                x = int((start_x - 0.2) * fontw),
                 y = start_y * fonth,
+                # y = (start_y + 1) * fonth, # (for tmux top status bar)
                 w = width,
                 h = height,
                 filename = path)
>f07bb12f ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108