Canvas: implement quadraticCurveTo().

This commit is contained in:
Mátyás Mustoha 2015-02-19 15:18:36 +01:00
parent 7bd6cb0091
commit 2817f2e066
7 changed files with 19 additions and 13 deletions

View file

@ -154,6 +154,11 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D>
self.renderer.send(CanvasMsg::LineTo(Point2D(x as f32, y as f32))).unwrap();
}
fn QuadraticCurveTo(self, cpx: f64, cpy: f64, x: f64, y: f64) {
self.renderer.send(CanvasMsg::QuadraticCurveTo(Point2D(cpx as f32, cpy as f32),
Point2D(x as f32, y as f32))).unwrap();
}
fn BezierCurveTo(self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, x: f64, y: f64) {
self.renderer.send(CanvasMsg::BezierCurveTo(Point2D(cp1x as f32, cp1y as f32),
Point2D(cp2x as f32, cp2y as f32),

View file

@ -124,7 +124,7 @@ interface CanvasPathMethods {
void closePath();
void moveTo(/*unrestricted*/ double x, /*unrestricted*/ double y);
void lineTo(double x, double y);
//void quadraticCurveTo(double cpx, double cpy, double x, double y);
void quadraticCurveTo(double cpx, double cpy, double x, double y);
void bezierCurveTo(/*unrestricted*/ double cp1x,
/*unrestricted*/ double cp1y,