mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 14:29:07 +08:00
deprecate some methods
This commit is contained in:
parent
734a66a75c
commit
29badd7f6c
@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## **NOT RELEASED V8**
|
||||
|
||||
This is going to be a very large release.
|
||||
This is going to be a very large release. The long term of Konva API is to make it simpler and faster. So when possible I am trying to optimize the code and remove unpopular/confusing API methods.
|
||||
|
||||
**BREAKING:**
|
||||
|
||||
|
10
konva.js
10
konva.js
@ -5,7 +5,7 @@
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
/*
|
||||
* Konva JavaScript Framework v8.0.0-0
|
||||
* Konva JavaScript Framework v8.0.0-1
|
||||
* http://konvajs.org/
|
||||
* Licensed under the MIT
|
||||
* Date: Sun May 09 2021
|
||||
@ -35,7 +35,7 @@
|
||||
: {};
|
||||
const Konva$2 = {
|
||||
_global: glob,
|
||||
version: '8.0.0-0',
|
||||
version: '8.0.0-1',
|
||||
isBrowser: detectBrowser(),
|
||||
isUnminified: /param/.test(function (param) { }.toString()),
|
||||
dblClickWindow: 400,
|
||||
@ -922,11 +922,11 @@
|
||||
},
|
||||
_degToRad(deg) {
|
||||
Util.warn('Util._degToRad is removed. Please use public Util.degToRad instead.');
|
||||
return Util._degToRad(deg);
|
||||
return Util.degToRad(deg);
|
||||
},
|
||||
_radToDeg(rad) {
|
||||
Util.warn('Util._radToDeg is removed. Please use public Util.radToDeg instead.');
|
||||
return Util._radToDeg(rad);
|
||||
return Util.radToDeg(rad);
|
||||
},
|
||||
_getRotation(radians) {
|
||||
return Konva$2.angleDeg ? Util.radToDeg(radians) : radians;
|
||||
@ -6652,7 +6652,6 @@
|
||||
* @name Konva.Shape#getContext
|
||||
* @returns {Konva.Context}
|
||||
*/
|
||||
// TODO: remove method
|
||||
getContext() {
|
||||
return this.getLayer().getContext();
|
||||
}
|
||||
@ -6662,7 +6661,6 @@
|
||||
* @name Konva.Shape#getCanvas
|
||||
* @returns {Konva.Canvas}
|
||||
*/
|
||||
// TODO: remove method
|
||||
getCanvas() {
|
||||
return this.getLayer().getCanvas();
|
||||
}
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "konva",
|
||||
"version": "8.0.0-0",
|
||||
"version": "8.0.0-2",
|
||||
"author": "Anton Lavrenov",
|
||||
"files": [
|
||||
"README.md",
|
||||
|
@ -108,9 +108,6 @@ var ABSOLUTE_OPACITY = 'absoluteOpacity',
|
||||
].join(SPACE),
|
||||
SCALE_CHANGE_STR = ['scaleXChange.konva', 'scaleYChange.konva'].join(SPACE);
|
||||
|
||||
// TODO: can we remove children from node?
|
||||
const emptyChildren = [];
|
||||
|
||||
let idCounter = 1;
|
||||
|
||||
// create all the events here
|
||||
|
16
src/Shape.ts
16
src/Shape.ts
@ -197,24 +197,12 @@ export class Shape<
|
||||
shapes[key] = this;
|
||||
}
|
||||
|
||||
/**
|
||||
* get canvas context tied to the layer
|
||||
* @method
|
||||
* @name Konva.Shape#getContext
|
||||
* @returns {Konva.Context}
|
||||
*/
|
||||
// TODO: remove method
|
||||
getContext() {
|
||||
Util.warn('shape.getContext() method is deprecated. Please don not use it.');
|
||||
return this.getLayer().getContext();
|
||||
}
|
||||
/**
|
||||
* get canvas renderer tied to the layer. Note that this returns a canvas renderer, not a canvas element
|
||||
* @method
|
||||
* @name Konva.Shape#getCanvas
|
||||
* @returns {Konva.Canvas}
|
||||
*/
|
||||
// TODO: remove method
|
||||
getCanvas() {
|
||||
Util.warn('shape.getCanvas() method is deprecated. Please don not use it.');
|
||||
return this.getLayer().getCanvas();
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ var STAGE = 'Stage',
|
||||
MOUSEMOVE = 'mousemove',
|
||||
MOUSEDOWN = 'mousedown',
|
||||
MOUSEUP = 'mouseup',
|
||||
// TODO: add them into "on" method docs and into site docs
|
||||
|
||||
POINTERMOVE = 'pointermove',
|
||||
POINTERDOWN = 'pointerdown',
|
||||
POINTERUP = 'pointerup',
|
||||
|
@ -909,7 +909,6 @@ describe('DragAndDrop', function () {
|
||||
]
|
||||
);
|
||||
});
|
||||
// TODO: try to move two shapes on different stages
|
||||
|
||||
it('can stop drag on dragstart without changing position later', function () {
|
||||
var stage = addStage();
|
||||
|
@ -30,8 +30,6 @@ describe('Text', function () {
|
||||
assert.equal(layer.getContext().getTrace(), trace);
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
// TODO: what is the best UX here?
|
||||
it('check text with FALSY values', function () {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
|
@ -385,7 +385,6 @@ describe('TouchEvents', function () {
|
||||
);
|
||||
|
||||
// now try to make two touches at the same time
|
||||
// TODO: should we trigger touch end first?
|
||||
simulateTouchStart(
|
||||
stage,
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user