Hello!
I'm not sure how far you have dug into rendering, but there are these things called InRowSpacers. They decide how much room is added between the elements in a row. An element is something like a corner, a field, an input, etc. The top row(the row causing us the problem here) is made up of a RoundCorner, an InRowSpacer and a SquareCorner. The InRowSpacer is the incorrect width in this situation which is causing the top row to be the incorrect size.
alignRowElements_ is in charge of adding any missing space to the InRowSpacers so that each row is the correct width. I think
this line should be changed to
nextRightEdge = Math.max(row.width, row.nextRightEdge); What was happening was the topRow.nextRightEdge was getting set to the previous rows width(lets say 100px). However, that previous row had a wider nextRightEdge (let's say 150px). So when we went farther down in the method to calculate the
desiredWidth of the block, the previous row would get a width of 150px(the correct size) because that was its nextRightEdge. However, the topRow would only get set to its own nextRightEdge which was 100px(the outdated width of the previous block).
I'm not sure if that made any sense, so please feel free to ask any questions! Also, I find the best way to debug rendering problems is using the debug section of the
advanced playground. It draws boxes of all the different elements that make up a block which makes visualizing what is happening so much easier! Also happy to help you set that up if that is interesting to you.
Cheers,
Abby