mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 00:40:15 +03:00
Center broken object indicator.
This commit is contained in:
parent
d0cb1d4e66
commit
5621bca772
@ -674,18 +674,25 @@ bool html_redraw_box(const html_content *html, struct box *box,
|
|||||||
|
|
||||||
if (!content_redraw(box->object, &obj_data, &r, ctx)) {
|
if (!content_redraw(box->object, &obj_data, &r, ctx)) {
|
||||||
/* Show image fail */
|
/* Show image fail */
|
||||||
|
/* Unicode (U+FFFC) 'OBJECT REPLACEMENT CHARACTER' */
|
||||||
|
const char *obj = "\xef\xbf\xbc";
|
||||||
|
int obj_width;
|
||||||
|
int obj_x = x + padding_left;
|
||||||
if (!plot->rectangle(x + padding_left,
|
if (!plot->rectangle(x + padding_left,
|
||||||
y + padding_top,
|
y + padding_top,
|
||||||
x + padding_left + width - 1,
|
x + padding_left + width - 1,
|
||||||
y + padding_top + height - 1,
|
y + padding_top + height - 1,
|
||||||
plot_style_broken_object))
|
plot_style_broken_object))
|
||||||
return false;
|
return false;
|
||||||
/* Show Unicode (U+FFFC) 'OBJECT REPLACEMENT CHARACTER'
|
if (!nsfont.font_width(plot_fstyle_broken_object, obj,
|
||||||
*/
|
sizeof(obj) - 1, &obj_width))
|
||||||
if (!plot->text(x + padding_left,
|
obj_x += 1;
|
||||||
y + padding_top + (int)
|
else
|
||||||
|
obj_x += width / 2 - obj_width / 2;
|
||||||
|
|
||||||
|
if (!plot->text(obj_x, y + padding_top + (int)
|
||||||
(height * 0.75 * scale),
|
(height * 0.75 * scale),
|
||||||
"\xef\xbf\xbc", 3,
|
obj, sizeof(obj) - 1,
|
||||||
plot_fstyle_broken_object))
|
plot_fstyle_broken_object))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user