@@ -71,6 +71,7 @@ struct View : public Ui::View<View> {
71
71
}
72
72
73
73
void paint (Gfx::Canvas& g, Math::Recti rect) override {
74
+ // Painting browser's viewport.
74
75
auto viewport = bound ().size ();
75
76
if (not _renderResult) {
76
77
auto media = _constructMedia (viewport);
@@ -82,10 +83,11 @@ struct View : public Ui::View<View> {
82
83
g.origin (bound ().xy .cast <f64>());
83
84
g.clip (viewport);
84
85
85
- auto [_, layout, paint, frag] = *_renderResult;
86
- g.clear (rect, Gfx::WHITE);
86
+ auto [_, layout, paint, frag, canvasColor] = *_renderResult;
87
+ auto paintRect = rect.offset (-bound ().xy );
88
+ g.clear (paintRect, canvasColor);
87
89
88
- paint->paint (g, rect. offset (- bound (). xy ) .cast <f64>());
90
+ paint->paint (g, paintRect .cast <f64>());
89
91
if (_props.wireframe )
90
92
Layout::wireframe (*frag, g);
91
93
@@ -100,7 +102,7 @@ struct View : public Ui::View<View> {
100
102
Math::Vec2i size (Math::Vec2i size, Ui::Hint) override {
101
103
// FIXME: This is wasteful, we should cache the result
102
104
auto media = _constructMedia (size);
103
- auto [_, layout, _, frag] = Driver::render (*_dom, media, {.small = size.cast <Au>()});
105
+ auto [_, layout, _, frag, _ ] = Driver::render (*_dom, media, {.small = size.cast <Au>()});
104
106
105
107
return {
106
108
frag->metrics .borderBox ().width .cast <isize>(),
0 commit comments