Skip to content

Commit

Permalink
Remove special handling for empty layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Jun 14, 2024
1 parent d2f963d commit f6eed61
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions parley/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,6 @@ fn build_into_layout<B: Brush>(
lcx: &mut LayoutContext<B>,
fcx: &mut FontContext,
) {
// Force a layout to have at least one line.
// TODO: support layouts with no text
let is_empty = text.is_empty();
let text = if is_empty { " " } else { text };

layout.data.clear();
layout.data.scale = scale;
layout.data.has_bidi = !lcx.bidi.levels().is_empty();
Expand Down Expand Up @@ -223,15 +218,4 @@ fn build_into_layout<B: Brush>(
core::mem::swap(&mut layout.data.inline_boxes, &mut lcx.inline_boxes);

layout.data.finish();

// Extra processing if the text is empty
// TODO: update this logic to work with inline boxes
if is_empty {
layout.data.text_len = 0;
if let Some(run) = layout.data.runs.get_mut(0) {
run.cluster_range.end = 0;
run.text_range.end = 0;
}
layout.data.clusters.clear();
}
}

0 comments on commit f6eed61

Please sign in to comment.