Store resolved font style in canvas context state

This commit is contained in:
Utsav Oza 2020-06-03 15:47:44 +05:30
parent 5493424d9a
commit 15fd256302
11 changed files with 81 additions and 49 deletions

View file

@ -288,7 +288,8 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
// https://html.spec.whatwg.org/multipage/#dom-context-2d-filltext
fn FillText(&self, text: DOMString, x: f64, y: f64, max_width: Option<f64>) {
self.canvas_state.fill_text(text, x, y, max_width);
self.canvas_state
.fill_text(self.canvas.as_ref().map(|c| &**c), text, x, y, max_width);
self.mark_as_dirty();
}