Windows: Fix direct_write crash when clicking an empty line (#11117)
Windows platform direct_write using `LineLayout::default` indicates `font_size` will be 0. Zed crashed when click empty line. Release Notes: - N/A
This commit is contained in:
parent
c826ad2f82
commit
c8a496ec4b
1 changed files with 4 additions and 1 deletions
|
@ -367,7 +367,10 @@ impl DirectWriteState {
|
|||
|
||||
fn layout_line(&mut self, text: &str, font_size: Pixels, font_runs: &[FontRun]) -> LineLayout {
|
||||
if font_runs.is_empty() {
|
||||
return LineLayout::default();
|
||||
return LineLayout {
|
||||
font_size,
|
||||
..Default::default()
|
||||
};
|
||||
}
|
||||
unsafe {
|
||||
let text_renderer = self.components.text_renderer.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue