Fix italic repaint problem

This commit is contained in:
daa 2017-04-23 12:54:46 +03:00
parent 319438b2c6
commit 37c8b48015

View File

@ -137,7 +137,7 @@ impl State {
let mut rect = rect.as_ref().clone(); let mut rect = rect.as_ref().clone();
// this need to repain also line under curren line // this need to repain also line under curren line
// in case underscore or 'g' symbol is go here // in case underscore or 'g' symbol is go here
rect.extend(0, 1, 0, 0); rect.extend(0, 1, 0, 1);
let (x, y, width, height) = rect.to_area(line_height, char_width); let (x, y, width, height) = rect.to_area(line_height, char_width);
self.drawing_area.queue_draw_area(x, y, width, height); self.drawing_area.queue_draw_area(x, y, width, height);
} }
@ -446,8 +446,9 @@ fn get_model_clip(state: &State,
ModelRect::from_area(line_height, char_width, clip.0, clip.1, clip.2, clip.3); ModelRect::from_area(line_height, char_width, clip.0, clip.1, clip.2, clip.3);
// in some cases symbols from previous row affect next row // in some cases symbols from previous row affect next row
// for example underscore symbol or 'g' // for example underscore symbol or 'g'
// also for italic text it is possible that symbol can affect next one
// see deference between logical rect and ink rect // see deference between logical rect and ink rect
model_clip.extend(1, 0, 0, 0); model_clip.extend(1, 0, 1, 0);
state.model.limit_to_model(&mut model_clip); state.model.limit_to_model(&mut model_clip);
model_clip model_clip