mirror of
https://github.com/konvajs/konva.git
synced 2025-10-08 00:14:23 +08:00
toDataURL fixes
This commit is contained in:
@@ -8,7 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
## Fixed
|
||||
|
||||
* Some `Konva.Transformer` fixes
|
||||
|
||||
* Typescript fixes
|
||||
* `stage.toDataURL()` fixes when it has hidden layers
|
||||
|
||||
## [2.1.7][2018-07-03]
|
||||
|
||||
|
5
konva.js
5
konva.js
@@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v2.1.7
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT
|
||||
* Date: Thu Jul 12 2018
|
||||
* Date: Wed Jul 18 2018
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
@@ -10369,6 +10369,9 @@
|
||||
}
|
||||
|
||||
layers.each(function(layer) {
|
||||
if (!layer.isVisible()) {
|
||||
return;
|
||||
}
|
||||
var width = layer.getCanvas().getWidth();
|
||||
var height = layer.getCanvas().getHeight();
|
||||
var ratio = layer.getCanvas().getPixelRatio();
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -252,6 +252,9 @@
|
||||
}
|
||||
|
||||
layers.each(function(layer) {
|
||||
if (!layer.isVisible()) {
|
||||
return;
|
||||
}
|
||||
var width = layer.getCanvas().getWidth();
|
||||
var height = layer.getCanvas().getHeight();
|
||||
var ratio = layer.getCanvas().getPixelRatio();
|
||||
|
@@ -1060,6 +1060,23 @@ suite('Stage', function() {
|
||||
assert.equal(stage.toDataURL(), layer.toDataURL());
|
||||
});
|
||||
|
||||
test('toDataURL with hidden layer', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
var circle = new Konva.Circle({
|
||||
x: stage.width() / 2,
|
||||
y: stage.height() / 2,
|
||||
fill: 'red',
|
||||
radius: 50
|
||||
});
|
||||
layer.add(circle);
|
||||
stage.add(layer);
|
||||
|
||||
var stageDataUrl = stage.toDataURL();
|
||||
layer.visible(false);
|
||||
assert.equal(stage.toDataURL() === stageDataUrl, false);
|
||||
});
|
||||
|
||||
test('toCanvas with large size', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
|
Reference in New Issue
Block a user