cairo_container: fix handling of invalid list-style-image
page: https://en.wikipedia.org/wiki/UTF-8#Invalid_sequences_and_error_handling culprit: ul{list-style-image:url(/w/skins/Vector/resources/common/images/bullet-icon.svg?d4515)} (invalid because svg is not supported)
This commit is contained in:
parent
ab66cb0999
commit
ea3c8f7f33
@ -148,38 +148,39 @@ void cairo_container::draw_list_marker( litehtml::uint_ptr hdc, const litehtml::
|
||||
if(img_i->second)
|
||||
{
|
||||
draw_txdib((cairo_t*)hdc, img_i->second.get(), marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height);
|
||||
unlock_images_cache();
|
||||
return;
|
||||
}
|
||||
}
|
||||
unlock_images_cache();
|
||||
} else
|
||||
}
|
||||
|
||||
switch(marker.marker_type)
|
||||
{
|
||||
switch(marker.marker_type)
|
||||
case litehtml::list_style_type_circle:
|
||||
{
|
||||
case litehtml::list_style_type_circle:
|
||||
{
|
||||
draw_ellipse((cairo_t*) hdc, marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height, marker.color, 0.5);
|
||||
}
|
||||
break;
|
||||
case litehtml::list_style_type_disc:
|
||||
{
|
||||
fill_ellipse((cairo_t*) hdc, marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height, marker.color);
|
||||
}
|
||||
break;
|
||||
case litehtml::list_style_type_square:
|
||||
if(hdc)
|
||||
{
|
||||
cairo_t* cr = (cairo_t*) hdc;
|
||||
cairo_save(cr);
|
||||
|
||||
cairo_new_path(cr);
|
||||
cairo_rectangle(cr, marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height);
|
||||
|
||||
set_color(cr, marker.color);
|
||||
cairo_fill(cr);
|
||||
cairo_restore(cr);
|
||||
}
|
||||
break;
|
||||
draw_ellipse((cairo_t*) hdc, marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height, marker.color, 0.5);
|
||||
}
|
||||
break;
|
||||
case litehtml::list_style_type_disc:
|
||||
{
|
||||
fill_ellipse((cairo_t*) hdc, marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height, marker.color);
|
||||
}
|
||||
break;
|
||||
case litehtml::list_style_type_square:
|
||||
if(hdc)
|
||||
{
|
||||
cairo_t* cr = (cairo_t*) hdc;
|
||||
cairo_save(cr);
|
||||
|
||||
cairo_new_path(cr);
|
||||
cairo_rectangle(cr, marker.pos.x, marker.pos.y, marker.pos.width, marker.pos.height);
|
||||
|
||||
set_color(cr, marker.color);
|
||||
cairo_fill(cr);
|
||||
cairo_restore(cr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user