aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorAraki Ken <arakiken@users.sf.net>2013-03-11 12:57:49 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 11:47:04 +0000
commita95a17897125a4268864b6a67e4fdb79fa5439a3 (patch)
tree5347ab8ee89568448df1fbe3969236603c83844b /file.c
parent- Adjust the image size to the terminal cell size. - If the image size is spe... (diff)
downloadw3m-a95a17897125a4268864b6a67e4fdb79fa5439a3.tar.gz
w3m-a95a17897125a4268864b6a67e4fdb79fa5439a3.zip
* terms.c: Change time to wait for the response of "\x1b[14t\x1b[18t" from 0.1 sec to 0.5 sec.
* image.c: - clearImage() works. - Use cached image files created by w3m in getImage(). * file.c: Hack for alignment.
Diffstat (limited to '')
-rw-r--r--file.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/file.c b/file.c
index 1e363d0..10ad444 100644
--- a/file.c
+++ b/file.c
@@ -3377,19 +3377,21 @@ process_img(struct parsed_tag *tag, int width)
if (i0 >= 0)
Strcat(tmp, Sprintf(" height=%d", i0));
switch (align) {
+ case ALIGN_MIDDLE:
+ if (!support_remote_image) {
+ top = ni / 2;
+ bottom = top;
+ if (top * 2 == ni)
+ yoffset = (int)(((ni + 1) * pixel_per_line - i) / 2);
+ else
+ yoffset = (int)((ni * pixel_per_line - i) / 2);
+ break;
+ }
case ALIGN_TOP:
top = 0;
bottom = ni - 1;
yoffset = 0;
break;
- case ALIGN_MIDDLE:
- top = ni / 2;
- bottom = top;
- if (top * 2 == ni)
- yoffset = (int)(((ni + 1) * pixel_per_line - i) / 2);
- else
- yoffset = (int)((ni * pixel_per_line - i) / 2);
- break;
case ALIGN_BOTTOM:
top = ni - 1;
bottom = 0;
@@ -3407,7 +3409,12 @@ process_img(struct parsed_tag *tag, int width)
}
break;
}
- xoffset = (int)((nw * pixel_per_char - w) / 2);
+
+ if (support_remote_image)
+ xoffset = 0;
+ else
+ xoffset = (int)((nw * pixel_per_char - w) / 2);
+
if (xoffset)
Strcat(tmp, Sprintf(" xoffset=%d", xoffset));
if (yoffset)