gfx: Show the text in the display item when debugging.

This commit is contained in:
Emilio Cobos Álvarez 2017-03-10 03:30:07 +01:00
parent 58c6aad1f0
commit ebdc6f69b1
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -1222,7 +1222,11 @@ impl fmt::Debug for DisplayItem {
solid_color.color.g, solid_color.color.g,
solid_color.color.b, solid_color.color.b,
solid_color.color.a), solid_color.color.a),
DisplayItem::Text(_) => "Text".to_owned(), DisplayItem::Text(ref text) => {
format!("Text ({:?})",
&text.text_run.text[
text.range.begin().0 as usize..(text.range.begin().0 + text.range.length().0) as usize])
}
DisplayItem::Image(_) => "Image".to_owned(), DisplayItem::Image(_) => "Image".to_owned(),
DisplayItem::WebGL(_) => "WebGL".to_owned(), DisplayItem::WebGL(_) => "WebGL".to_owned(),
DisplayItem::Border(_) => "Border".to_owned(), DisplayItem::Border(_) => "Border".to_owned(),