This method was introduced in Gecko 1.9 and is unimplemented starting with Gecko 7.0. CanvasRenderingContext2D.mozMeasureText() Use CanvasRenderingContext2D.strokeText() or CanvasRenderingContext2D.fillText() instead. This method was introduced in Gecko 1.9 and is removed starting with Gecko 7.0. Introduced in Gecko 1.9, deprecated in favor of the CanvasRenderingContext2D.font property. See CanvasRenderingContext2D.imageSmoothingEnabled. CanvasRenderingContext2D.mozImageSmoothingEnabled Sets or gets the current inversed transformation matrix. CanvasRenderingContext2D.mozCurrentTransformInverse Sets or gets the current transformation matrix, see CanvasRenderingContext2D.currentTransform. Prefixed APIs CanvasRenderingContext2D.mozCurrentTransform Use CanvasRenderingContext2D.imageSmoothingEnabled instead.
CanvasRenderingContext2D.webkitImageSmoothingEnabled Use CanvasRenderingContext2D.lineDashOffset instead. CanvasRenderingContext2D.webkitLineDashOffset Use CanvasRenderingContext2D.getLineDash() and tLineDash() instead. Use CanvasRenderingContext2D.shadowColor and CanvasRenderingContext2D.shadowBlur instead. Use CanvasRenderingContext2D.fillStyle instead. Use CanvasRenderingContext2D.strokeStyle instead. Use CanvasRenderingContext2D.miterLimit instead. Use CanvasRenderingContext2D.lineCap instead. Use CanvasRenderingContext2D.lineJoin instead. Use CanvasRenderingContext2D.lineWidth instead. Use CanvasRenderingContext2D.globalCompositeOperation instead. Use CanvasRenderingContext2D.globalAlpha instead. This is redundant with an equivalent overload of drawImage. CanvasRenderingContext2D.drawImageFromRect() Removes all shadow settings like CanvasRenderingContext2D.shadowColor and CanvasRenderingContext2D.shadowBlur. Most of these APIs are deprecated and were removed shortly after Chrome 36. Resets the current transform by the identity matrix. CanvasRenderingContext2D.resetTransform() Resets the current transform to the identity matrix, and then invokes the transform() method with the same arguments. Multiplies the current transformation matrix with the matrix described by its arguments. anslate()Īdds a translation transformation by moving the canvas and its origin x horzontally and y vertically on the grid. CanvasRenderingContext2D.scale()Īdds a scaling transformation to the canvas units by x horizontally and by y vertically. The angle argument represents a clockwise rotation angle and is expressed in radians. CanvasRenderingContext2D.rotate()Īdds a rotation to the transformation matrix. Retrieves the current transformation matrix being applied to the context. CanvasRenderingContext2D.currentTransformĬurrent transformation matrix ( DOMMatrix object). The methods listed below remain for historical and compatibility reasons as DOMMatrix objects are used in most parts of the API nowadays and will be used in the future instead. The transformation matrix is applied when creating the current default path, painting text, shapes and Path2D objects. Objects in the CanvasRenderingContext2D rendering context have a current transformation matrix and methods to manipulate it. CanvasRenderingContext2D.rect()Ĭreates a path for a rectangle at position (x, y) with a size that is determined by width and height. CanvasRenderingContext2D.ellipse()Īdds an elliptical arc to the current path. CanvasRenderingContext2D.arcTo()Īdds an arc to the current path with the given control points and radius, connected to the previous point by a straight line. CanvasRenderingContext2D.arc()Īdds a circular arc to the current path. CanvasRenderingContext2D.quadraticCurveTo()Īdds a quadratic Bézier curve to the current path. CanvasRenderingContext2D.bezierCurveTo()Īdds a cubic Bézier curve to the current path. CanvasRenderingContext2D.lineTo()Ĭonnects the last point in the current sub-path to the specified (x, y) coordinates with a straight line. Moves the starting point of a new sub-path to the (x, y) coordinates. If the shape has already been closed or has only one point, this function does nothing. It tries to draw a straight line from the current point to the start. CanvasRenderingContext2D.closePath()Ĭauses the point of the pen to move back to the start of the current sub-path. Call this method when you want to create a new path. Starts a new path by emptying the list of sub-paths. The following methods can be used to manipulate paths of objects.