mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Store resolved font style in canvas context state
This commit is contained in:
parent
5493424d9a
commit
15fd256302
11 changed files with 81 additions and 49 deletions
|
@ -60,11 +60,6 @@ impl OffscreenCanvasRenderingContext2D {
|
|||
));
|
||||
reflect_dom_object(boxed, global)
|
||||
}
|
||||
/*
|
||||
pub fn get_canvas_state(&self) -> Ref<CanvasState> {
|
||||
self.canvas_state.borrow()
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn set_canvas_bitmap_dimensions(&self, size: Size2D<u64>) {
|
||||
self.canvas_state.set_bitmap_dimensions(size);
|
||||
|
@ -249,7 +244,13 @@ impl OffscreenCanvasRenderingContext2DMethods for OffscreenCanvasRenderingContex
|
|||
|
||||
// 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.htmlcanvas.as_ref().map(|c| &**c),
|
||||
text,
|
||||
x,
|
||||
y,
|
||||
max_width,
|
||||
)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#textmetrics
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue