fix stage.toDataURL defaults

This commit is contained in:
Anton Lavrenov
2018-04-19 14:33:45 +07:00
parent f1e7bf0e8e
commit 272dafe398
5 changed files with 17 additions and 20 deletions

View File

@@ -1641,7 +1641,7 @@
* @param {Number} [config.quality] jpeg quality. If using an "image/jpeg" mimeType,
* you can specify the quality from 0 to 1, where 0 is very poor quality and 1
* is very high quality
* @paremt {Number} [config.pixelRatio] pixelRatio of ouput image url. Default is 1
* @param {Number} [config.pixelRatio] pixelRatio of output image url. Default is 1
* @returns {String}
*/
toDataURL: function(config) {

View File

@@ -232,22 +232,6 @@
getContent: function() {
return this.content;
},
/**
* Creates a composite data URL
* @method
* @memberof Konva.Stage.prototype
* @param {Object} config
* @param {Function} [config.callback] function executed when the composite has completed. Deprecated as method is sync now.
* @param {String} [config.mimeType] can be "image/png" or "image/jpeg".
* "image/png" is the default
* @param {Number} [config.x] x position of canvas section
* @param {Number} [config.y] y position of canvas section
* @param {Number} [config.width] width of canvas section
* @param {Number} [config.height] height of canvas section
* @param {Number} [config.quality] jpeg quality. If using an "image/jpeg" mimeType,
* you can specify the quality from 0 to 1, where 0 is very poor quality and 1
* is very high quality
*/
toDataURL: function(config) {
config = config || {};
@@ -258,7 +242,7 @@
canvas = new Konva.SceneCanvas({
width: config.width || this.getWidth(),
height: config.height || this.getHeight(),
pixelRatio: config.pixelRatio
pixelRatio: config.pixelRatio || 1
}),
_context = canvas.getContext()._context,
layers = this.children;