@@ -38,17 +38,19 @@ void FormattingState::commit()
38
38
node.box_model ().border = { node_state.border_top , node_state.border_right , node_state.border_bottom , node_state.border_left };
39
39
node.box_model ().margin = { node_state.margin_top , node_state.margin_right , node_state.margin_bottom , node_state.margin_left };
40
40
41
+ node.set_paintable (node.create_paintable ());
42
+
41
43
// For boxes, transfer all the state needed for painting.
42
44
if (is<Layout::Box>(node)) {
43
45
auto & box = static_cast <Layout::Box&>(node);
44
- box. set_paint_box ( box.create_paintable ());
45
- box. m_paint_box -> set_offset (node_state.offset );
46
- box. m_paint_box -> set_content_size (node_state.content_width , node_state.content_height );
47
- box. m_paint_box -> set_overflow_data (move (node_state.overflow_data ));
48
- box. m_paint_box -> set_containing_line_box_fragment (node_state.containing_line_box_fragment );
46
+ auto & paint_box = const_cast <Painting::PaintableBox&>(* box.paint_box ());
47
+ paint_box. set_offset (node_state.offset );
48
+ paint_box. set_content_size (node_state.content_width , node_state.content_height );
49
+ paint_box. set_overflow_data (move (node_state.overflow_data ));
50
+ paint_box. set_containing_line_box_fragment (node_state.containing_line_box_fragment );
49
51
50
52
if (is<Layout::BlockContainer>(box))
51
- static_cast <Painting::PaintableWithLines&>(*box. m_paint_box ).set_line_boxes (move (node_state.line_boxes ));
53
+ static_cast <Painting::PaintableWithLines&>(paint_box ).set_line_boxes (move (node_state.line_boxes ));
52
54
}
53
55
}
54
56
}
0 commit comments