mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
enhance: Implement CanvasRenderingContext2D.measureText
(#32704)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
d82232d549
commit
1223335547
14 changed files with 325 additions and 51 deletions
|
@ -292,7 +292,8 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#textmetrics
|
||||
fn MeasureText(&self, text: DOMString) -> DomRoot<TextMetrics> {
|
||||
self.canvas_state.measure_text(&self.global(), text)
|
||||
self.canvas_state
|
||||
.measure_text(&self.global(), self.canvas.as_deref(), text)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-font
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue