allow font changing

macos-click-through
Keith Simmons 4 years ago
parent f4eff0e5c4
commit ff1954f9a9

@ -414,6 +414,9 @@ impl Editor {
self.draw_command_batcher self.draw_command_batcher
.queue(DrawCommand::FontChanged(guifont)) .queue(DrawCommand::FontChanged(guifont))
.ok(); .ok();
for window in self.windows.values() {
window.redraw();
}
} }
} }
} }

@ -200,8 +200,12 @@ impl Window {
*previous_style = style; *previous_style = style;
} }
// Send a draw command for the given row starting from current_start up until the next style
// change. If the current_start is the same as line_start, this will also work backwards in the
// line in order to ensure that ligatures before the beginning of the grid cell are also
// updated.
fn send_draw_command( fn send_draw_command(
&mut self, &self,
row_index: u64, row_index: u64,
line_start: u64, line_start: u64,
current_start: u64, current_start: u64,
@ -346,6 +350,20 @@ impl Window {
self.send_command(WindowDrawCommand::Clear); self.send_command(WindowDrawCommand::Clear);
} }
pub fn redraw(&self) {
self.send_command(WindowDrawCommand::Clear);
for row in 0..self.grid.height {
let mut current_start = 0;
while current_start < self.grid.width {
if let Some(next_start) = self.send_draw_command(row, 0, current_start) {
current_start = next_start;
} else {
break;
}
}
}
}
pub fn hide(&self) { pub fn hide(&self) {
self.send_command(WindowDrawCommand::Hide); self.send_command(WindowDrawCommand::Hide);
} }

Loading…
Cancel
Save