* 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.
This commit is contained in:
committed by
Tatsuya Kinoshita
parent
147ef0048b
commit
a95a178971
@@ -3377,19 +3377,21 @@ process_img(struct parsed_tag *tag, int width)
|
|||||||
if (i0 >= 0)
|
if (i0 >= 0)
|
||||||
Strcat(tmp, Sprintf(" height=%d", i0));
|
Strcat(tmp, Sprintf(" height=%d", i0));
|
||||||
switch (align) {
|
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:
|
case ALIGN_TOP:
|
||||||
top = 0;
|
top = 0;
|
||||||
bottom = ni - 1;
|
bottom = ni - 1;
|
||||||
yoffset = 0;
|
yoffset = 0;
|
||||||
break;
|
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:
|
case ALIGN_BOTTOM:
|
||||||
top = ni - 1;
|
top = ni - 1;
|
||||||
bottom = 0;
|
bottom = 0;
|
||||||
@@ -3407,7 +3409,12 @@ process_img(struct parsed_tag *tag, int width)
|
|||||||
}
|
}
|
||||||
break;
|
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)
|
if (xoffset)
|
||||||
Strcat(tmp, Sprintf(" xoffset=%d", xoffset));
|
Strcat(tmp, Sprintf(" xoffset=%d", xoffset));
|
||||||
if (yoffset)
|
if (yoffset)
|
||||||
|
|||||||
@@ -288,10 +288,6 @@ clearImage()
|
|||||||
int j;
|
int j;
|
||||||
TerminalImage *i;
|
TerminalImage *i;
|
||||||
|
|
||||||
if (support_remote_image) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!activeImage)
|
if (!activeImage)
|
||||||
return;
|
return;
|
||||||
if (!n_terminal_image)
|
if (!n_terminal_image)
|
||||||
@@ -600,7 +596,7 @@ getImage(Image * image, ParsedURL *current, int flag)
|
|||||||
if (image->height > 0 && image->height % pixel_per_line_i > 0)
|
if (image->height > 0 && image->height % pixel_per_line_i > 0)
|
||||||
image->height += (pixel_per_line_i - image->height % pixel_per_line_i);
|
image->height += (pixel_per_line_i - image->height % pixel_per_line_i);
|
||||||
|
|
||||||
if (image->height > 0 && image->width > 0)
|
if (! getenv("WINDOWID") && image->height > 0 && image->width > 0)
|
||||||
cache->loaded = IMG_FLAG_LOADED;
|
cache->loaded = IMG_FLAG_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ get_pixel_per_cell(int *ppc, int *ppl)
|
|||||||
p = buf;
|
p = buf;
|
||||||
left = sizeof(buf) - 1;
|
left = sizeof(buf) - 1;
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
tval.tv_usec = 100000; /* 0.1 sec */
|
tval.tv_usec = 500000; /* 0.5 sec */
|
||||||
tval.tv_sec = 0;
|
tval.tv_sec = 0;
|
||||||
FD_SET(tty,&rfd);
|
FD_SET(tty,&rfd);
|
||||||
if (select(tty+1,&rfd,NULL,NULL,&tval) <= 0 || ! FD_ISSET(tty,&rfd)) {
|
if (select(tty+1,&rfd,NULL,NULL,&tval) <= 0 || ! FD_ISSET(tty,&rfd)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user