Implement CanvasRenderingContext2d.fillText's "unimplemented" message

This commit is contained in:
Bruno Bernardino 2017-08-09 12:34:12 +01:00
parent 1c9c0334ba
commit 2af828485f
No known key found for this signature in database
GPG key ID: C8019746F44687CD
6 changed files with 35 additions and 3 deletions

View file

@ -133,6 +133,7 @@ impl<'a> CanvasPaintThread<'a> {
match msg.unwrap() {
CanvasMsg::Canvas2d(message) => {
match message {
Canvas2dMsg::FillText(text, x, y, max_width) => painter.fill_text(text, x, y, max_width),
Canvas2dMsg::FillRect(ref rect) => painter.fill_rect(rect),
Canvas2dMsg::StrokeRect(ref rect) => painter.stroke_rect(rect),
Canvas2dMsg::ClearRect(ref rect) => painter.clear_rect(rect),
@ -228,6 +229,10 @@ impl<'a> CanvasPaintThread<'a> {
}
}
fn fill_text(&self, text: String, x: f64, y: f64, max_width: Option<f64>) {
error!("Unimplemented canvas2d.fillText. Values received: {}, {}, {}, {:?}.", text, x, y, max_width);
}
fn fill_rect(&self, rect: &Rect<f32>) {
if is_zero_size_gradient(&self.state.fill_style) {
return; // Paint nothing if gradient size is zero.