Skip to content

Commit c168dae

Browse files
committed
Added jsdocs.
1 parent 065235a commit c168dae

3 files changed

Lines changed: 44 additions & 8 deletions

File tree

src/display/canvas/CanvasInterpolation.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
/**
2+
* @module Phaser.Display.Canvas.CanvasInterpolation
3+
* @since 3.0.0
4+
*/
15
var CanvasInterpolation = {
26

3-
// Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit).
4-
// Note that if this doesn't given the desired result then see the setSmoothingEnabled.
7+
/**
8+
* Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit).
9+
*
10+
* @function setCrisp
11+
* @since 3.0.0
12+
*
13+
* @param {HTMLCanvasElement} canvas - The canvas object to have the style set on.
14+
*
15+
* @return {HTMLCanvasElement} The canvas.
16+
*/
517
setCrisp: function (canvas)
618
{
719
var types = [ 'optimizeSpeed', 'crisp-edges', '-moz-crisp-edges', '-webkit-optimize-contrast', 'optimize-contrast', 'pixelated' ];
@@ -16,8 +28,16 @@ var CanvasInterpolation = {
1628
return canvas;
1729
},
1830

19-
// Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').
20-
// Note that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.
31+
/**
32+
* Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').
33+
*
34+
* @function setBicubic
35+
* @since 3.0.0
36+
*
37+
* @param {HTMLCanvasElement} canvas - The canvas object to have the style set on.
38+
*
39+
* @return {HTMLCanvasElement} The canvas.
40+
*/
2141
setBicubic: function (canvas)
2242
{
2343
canvas.style['image-rendering'] = 'auto';

src/display/canvas/TouchAction.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
/**
2-
* Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.
3-
*/
2+
* Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.
3+
*
4+
* @function Phaser.Display.Canvas.TouchAction
5+
* @since 3.0.0
6+
*
7+
* @param {HTMLCanvasElement} canvas - The canvas element to have the style applied to.
8+
* @param {string} [value='none'] - The touch action value to set on the canvas. Set to `none` to disable touch actions.
9+
*
10+
* @return {HTMLCanvasElement} The canvas element.
11+
*/
412
var TouchAction = function (canvas, value)
513
{
614
if (value === undefined) { value = 'none'; }

src/display/canvas/UserSelect.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
/**
2-
* Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.
3-
*/
2+
* Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.
3+
*
4+
* @function Phaser.Display.Canvas.UserSelect
5+
* @since 3.0.0
6+
*
7+
* @param {HTMLCanvasElement} canvas - The canvas element to have the style applied to.
8+
* @param {string} [value='none'] - The touch callout value to set on the canvas. Set to `none` to disable touch callouts.
9+
*
10+
* @return {HTMLCanvasElement} The canvas element.
11+
*/
412
var UserSelect = function (canvas, value)
513
{
614
if (value === undefined) { value = 'none'; }

0 commit comments

Comments
 (0)