← Back to context

Comment by troupo

6 months ago

> Originally, Egui was completely one pass.

Originally HTML was one-pass. Until they added tables. And tables require at least two passes to lay out.

There's only so far that you can take one pass rendering

> There's only so far that you can take one pass rendering

Right. The whole point of Egui was supposed to be that it was a game renderer, a text and button overlay on the game graphics. Not the entire screen. That's why it's immediate mode. It's supposed to redraw on every game frame. Most UI programs don't need or want that.

But it was better at the basics than anything else in Rust, so it caught on for routine non-game programs. And here we are.

  • > But it was better at the basics than anything else in Rust, so it caught on for routine non-game programs. And here we are.

    Seriously. The main tale I think is how awful Rust's story on GUIs are such that most Rust users prefer a pretty awful GUI library because it's somehow better than everything else. And that's coming from someone who's favorite language is easily Rust.

Consider me ignorant: why do you need two passes for table layout?

  • In a HTML table, unless given a fixed width, the width of each column depends on the natural widths of all the columns, and those widths depend on the content of every cell in the column, and those cell natural widths depend on word-wrapped layout as well as other layout of content in each cell, including nested tables recursively.

    In other words, with default styling you have to calculate natural widths of every cell in the whole table before you can begjn layout out even the first cell of the table.

    There are style settings you can use which change this, and allow layout of early cells or rows to complete without depending on later cells.

    (Also the height of each row can depend on the height of the content of every cell in the row. But that's local to each row so it's a relatively small dependency.)