mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 06:24:42 +08:00
remove warning
This commit is contained in:
parent
a106b3e34c
commit
289a16d298
@ -138,8 +138,6 @@
|
|||||||
'bottom-right'
|
'bottom-right'
|
||||||
];
|
];
|
||||||
|
|
||||||
var warningShowed = false;
|
|
||||||
|
|
||||||
Konva.Transformer.prototype = {
|
Konva.Transformer.prototype = {
|
||||||
_centroid: false,
|
_centroid: false,
|
||||||
____init: function(config) {
|
____init: function(config) {
|
||||||
@ -156,13 +154,6 @@
|
|||||||
// update transformer data for certain attr changes
|
// update transformer data for certain attr changes
|
||||||
this.on(ATTR_CHANGE_LIST, this.update);
|
this.on(ATTR_CHANGE_LIST, this.update);
|
||||||
|
|
||||||
if (!warningShowed) {
|
|
||||||
Konva.Util.warn(
|
|
||||||
'Konva.Transformer is currently experimental and may have bugs. Please report any issues to GitHub repo.'
|
|
||||||
);
|
|
||||||
warningShowed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getNode()) {
|
if (this.getNode()) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
@ -344,7 +335,7 @@
|
|||||||
// var angle = -Math.atan2(-dy, dx) - Math.PI / 2;
|
// var angle = -Math.atan2(-dy, dx) - Math.PI / 2;
|
||||||
var scale = tr.getNode().getAbsoluteScale();
|
var scale = tr.getNode().getAbsoluteScale();
|
||||||
// If scale.y < 0 xor scale.x < 0 we need to flip (not rotate).
|
// If scale.y < 0 xor scale.x < 0 we need to flip (not rotate).
|
||||||
var isMirrored = (scale.y * scale.x) < 0;
|
var isMirrored = scale.y * scale.x < 0;
|
||||||
var cursor = getCursor(name, rad, isMirrored);
|
var cursor = getCursor(name, rad, isMirrored);
|
||||||
anchor.getStage().content.style.cursor = cursor;
|
anchor.getStage().content.style.cursor = cursor;
|
||||||
layer.batchDraw();
|
layer.batchDraw();
|
||||||
@ -659,7 +650,7 @@
|
|||||||
update: function() {
|
update: function() {
|
||||||
var attrs = this._getNodeRect();
|
var attrs = this._getNodeRect();
|
||||||
var node = this.getNode();
|
var node = this.getNode();
|
||||||
var scale = node ? node.getAbsoluteScale() : {x: 1, y: 1};
|
var scale = node ? node.getAbsoluteScale() : { x: 1, y: 1 };
|
||||||
var invertedScale = {
|
var invertedScale = {
|
||||||
x: 1 / scale.x,
|
x: 1 / scale.x,
|
||||||
y: 1 / scale.y
|
y: 1 / scale.y
|
||||||
@ -721,7 +712,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
var scaledRotateHandlerOffset =
|
var scaledRotateHandlerOffset =
|
||||||
-this.rotateHandlerOffset() * Math.abs(invertedScale.y);
|
-this.rotateHandlerOffset() * Math.abs(invertedScale.y);
|
||||||
this.findOne('.rotater').setAttrs({
|
this.findOne('.rotater').setAttrs({
|
||||||
x: width / 2,
|
x: width / 2,
|
||||||
y: scaledRotateHandlerOffset * Konva.Util._sign(height),
|
y: scaledRotateHandlerOffset * Konva.Util._sign(height),
|
||||||
|
Loading…
Reference in New Issue
Block a user