Skip to content

Commit

Permalink
layout: Nuke currently-unused longest-line measurement code
Browse files Browse the repository at this point in the history
We'll need something along these lines later, but right now
whitespace-collapsing removes all newlines, so until we start caring
about the white-space property this is useless.
  • Loading branch information
robinlinden committed Oct 25, 2023
1 parent af2d34f commit 2f53c4d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions layout/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,7 @@ void layout(LayoutBox &box, geom::Rect const &bounds, int const root_font_size)

if (auto text = box.text()) {
// TODO(robinlinden): Measure the text for real.
if (text->contains('\n')) {
for (auto const &line : util::split(*text, "\n")) {
box.dimensions.content.width =
std::max(box.dimensions.content.width, text_width(line, font_size));
}
} else {
box.dimensions.content.width = text_width(*text, font_size);
}
box.dimensions.content.width = text_width(*text, font_size);
}

if (box.node->parent) {
Expand Down

0 comments on commit 2f53c4d

Please sign in to comment.