mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
remove some deprecations
This commit is contained in:
parent
a91e00fc05
commit
0363090052
@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
* new `Konva.Transformer` group that allow simple resize, and rotate of a shape.
|
* new `Konva.Transformer` group that allow simple resize, and rotate of a shape.
|
||||||
* Add ability to remove event by callback `node.off('event', callback)`.
|
* Add ability to remove event by callback `node.off('event', callback)`.
|
||||||
* new `Konva.Filters.Contrast`.
|
* new `Konva.Filters.Contrast`.
|
||||||
* new `Konva.Util.haveIntersection()` to detect collusion
|
* new `Konva.Util.haveIntersection()` to detect simple collusion
|
||||||
* add `Konva.Text.ellipsis` to add '…' to text string if width is fixed and wrap is set to 'none'
|
* add `Konva.Text.ellipsis` to add '…' to text string if width is fixed and wrap is set to 'none'
|
||||||
* add gradients for strokes
|
* add gradients for strokes
|
||||||
|
|
||||||
@ -23,6 +23,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
* Some typescript fixes
|
* Some typescript fixes
|
||||||
* Pixelate filter fixes
|
* Pixelate filter fixes
|
||||||
|
|
||||||
|
## Removed
|
||||||
|
|
||||||
|
* Some deprecated methods are removed. If previous version was working without deprecation warnings for you, this one will work fine too.
|
||||||
|
|
||||||
## [1.7.6][2017-11-01]
|
## [1.7.6][2017-11-01]
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
99
konva.js
99
konva.js
@ -2254,7 +2254,10 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
addDeprecatedGetterSetter: function(constructor, attr, def, validator) {
|
addDeprecatedGetterSetter: function(constructor, attr, def, validator) {
|
||||||
|
Konva.Util.error('Adding deprecated ' + attr);
|
||||||
|
|
||||||
var method = GET + Konva.Util._capitalize(attr);
|
var method = GET + Konva.Util._capitalize(attr);
|
||||||
|
|
||||||
var message =
|
var message =
|
||||||
attr +
|
attr +
|
||||||
' property is deprecated and will be removed soon. Look at Konva change log for more information.';
|
' property is deprecated and will be removed soon. Look at Konva change log for more information.';
|
||||||
@ -8431,7 +8434,12 @@
|
|||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
hasStroke: function() {
|
hasStroke: function() {
|
||||||
return this.strokeEnabled() && !!this.stroke();
|
return (
|
||||||
|
this.strokeEnabled() &&
|
||||||
|
!!(this.stroke() || this.getStrokeLinearGradientColorStops())
|
||||||
|
// TODO: do we need radial gradient
|
||||||
|
// this.getStrokeRadialGradientColorStops()
|
||||||
|
);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* determines if point is in the shape, regardless if other shapes are on top of it. Note: because
|
* determines if point is in the shape, regardless if other shapes are on top of it. Note: because
|
||||||
@ -8797,31 +8805,6 @@
|
|||||||
* shape.stroke('rgba(0,255,0,0.5');
|
* shape.stroke('rgba(0,255,0,0.5');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeRed',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeGreen',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeBlue',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeAlpha',
|
|
||||||
1,
|
|
||||||
Konva.Validators.alphaComponent
|
|
||||||
);
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'strokeWidth', 2);
|
Konva.Factory.addGetterSetter(Konva.Shape, 'strokeWidth', 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9037,31 +9020,6 @@
|
|||||||
* shape.shadowColor('rgba(0,255,0,0.5');
|
* shape.shadowColor('rgba(0,255,0,0.5');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowRed',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowGreen',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowBlue',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowAlpha',
|
|
||||||
1,
|
|
||||||
Konva.Validators.alphaComponent
|
|
||||||
);
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9205,31 +9163,6 @@
|
|||||||
* shape.fill(null);
|
* shape.fill(null);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillRed',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillGreen',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillBlue',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillAlpha',
|
|
||||||
1,
|
|
||||||
Konva.Validators.alphaComponent
|
|
||||||
);
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'fillPatternX', 0);
|
Konva.Factory.addGetterSetter(Konva.Shape, 'fillPatternX', 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9295,7 +9228,7 @@
|
|||||||
*
|
*
|
||||||
* // create a linear gradient that starts with red, changes to blue
|
* // create a linear gradient that starts with red, changes to blue
|
||||||
* // halfway through, and then changes to green
|
* // halfway through, and then changes to green
|
||||||
* shape.strokeLinearGradientColorStops(0, 'red', 0.5, 'blue', 1, 'green');
|
* shape.strokeLinearGradientColorStops([0, 'red', 0.5, 'blue', 1, 'green']);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(
|
Konva.Factory.addGetterSetter(
|
||||||
@ -9813,7 +9746,11 @@
|
|||||||
* shape.fillLinearGradientEndPointX(20);
|
* shape.fillLinearGradientEndPointX(20);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'strokeLinearGradientEndPointX', 0);
|
Konva.Factory.addGetterSetter(
|
||||||
|
Konva.Shape,
|
||||||
|
'strokeLinearGradientEndPointX',
|
||||||
|
0
|
||||||
|
);
|
||||||
/**
|
/**
|
||||||
* get/set fill linear gradient end point x
|
* get/set fill linear gradient end point x
|
||||||
* @name strokeLinearGradientEndPointX
|
* @name strokeLinearGradientEndPointX
|
||||||
@ -9845,7 +9782,11 @@
|
|||||||
* shape.fillLinearGradientEndPointY(20);
|
* shape.fillLinearGradientEndPointY(20);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'strokeLinearGradientEndPointY', 0);
|
Konva.Factory.addGetterSetter(
|
||||||
|
Konva.Shape,
|
||||||
|
'strokeLinearGradientEndPointY',
|
||||||
|
0
|
||||||
|
);
|
||||||
/**
|
/**
|
||||||
* get/set stroke linear gradient end point y
|
* get/set stroke linear gradient end point y
|
||||||
* @name strokeLinearGradientEndPointY
|
* @name strokeLinearGradientEndPointY
|
||||||
|
13
konva.min.js
vendored
13
konva.min.js
vendored
File diff suppressed because one or more lines are too long
83
src/Shape.js
83
src/Shape.js
@ -175,11 +175,9 @@
|
|||||||
hasStroke: function() {
|
hasStroke: function() {
|
||||||
return (
|
return (
|
||||||
this.strokeEnabled() &&
|
this.strokeEnabled() &&
|
||||||
!!(
|
!!(this.stroke() || this.getStrokeLinearGradientColorStops())
|
||||||
this.stroke() ||
|
// TODO: do we need radial gradient
|
||||||
this.getStrokeLinearGradientColorStops() ||
|
// this.getStrokeRadialGradientColorStops()
|
||||||
this.getStrokeRadialGradientColorStops()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -546,31 +544,6 @@
|
|||||||
* shape.stroke('rgba(0,255,0,0.5');
|
* shape.stroke('rgba(0,255,0,0.5');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeRed',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeGreen',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeBlue',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'strokeAlpha',
|
|
||||||
1,
|
|
||||||
Konva.Validators.alphaComponent
|
|
||||||
);
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'strokeWidth', 2);
|
Konva.Factory.addGetterSetter(Konva.Shape, 'strokeWidth', 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -786,31 +759,6 @@
|
|||||||
* shape.shadowColor('rgba(0,255,0,0.5');
|
* shape.shadowColor('rgba(0,255,0,0.5');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowRed',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowGreen',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowBlue',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'shadowAlpha',
|
|
||||||
1,
|
|
||||||
Konva.Validators.alphaComponent
|
|
||||||
);
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -954,31 +902,6 @@
|
|||||||
* shape.fill(null);
|
* shape.fill(null);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillRed',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillGreen',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillBlue',
|
|
||||||
0,
|
|
||||||
Konva.Validators.RGBComponent
|
|
||||||
);
|
|
||||||
Konva.Factory.addDeprecatedGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'fillAlpha',
|
|
||||||
1,
|
|
||||||
Konva.Validators.alphaComponent
|
|
||||||
);
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'fillPatternX', 0);
|
Konva.Factory.addGetterSetter(Konva.Shape, 'fillPatternX', 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user