Fix rendering

This commit is contained in:
daa84
2017-09-04 18:32:12 +03:00
parent 3bb326c8aa
commit c4ecd43ea0
4 changed files with 26 additions and 10 deletions

View File

@@ -22,7 +22,11 @@ impl Context {
}
pub fn itemize(&self, line: &StyledLine) -> Vec<sys_pango::Item> {
sys_pango::pango_itemize(&self.pango_context, line.line_str.trim_right(), &line.attr_list)
sys_pango::pango_itemize(
&self.pango_context,
line.line_str.trim_right(),
&line.attr_list,
)
}
}

View File

@@ -43,10 +43,14 @@ pub fn render(
}
}
pub fn shape_dirty(ctx: &context::Context, ui_model: &mut ui_model::UiModel) {
pub fn shape_dirty(
ctx: &context::Context,
ui_model: &mut ui_model::UiModel,
color_model: &color::ColorModel,
) {
for line in ui_model.model_mut() {
if line.dirty_line {
let styled_line = ui_model::StyledLine::from(line);
let styled_line = ui_model::StyledLine::from(line, color_model);
let items = ctx.itemize(&styled_line);
line.merge(&styled_line, &items);
@@ -77,4 +81,3 @@ pub fn shape_dirty(ctx: &context::Context, ui_model: &mut ui_model::UiModel) {
}
}
}