mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
Better calculations for container.getClientRect()
This commit is contained in:
@@ -1034,6 +1034,8 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else if (relativeTo && relativeTo !== parent) {
|
||||
return visible && parent._isVisible(relativeTo);
|
||||
} else {
|
||||
return visible;
|
||||
}
|
||||
|
@@ -735,8 +735,10 @@ export class Transformer extends Group {
|
||||
});
|
||||
|
||||
var padding = this.padding();
|
||||
var scaleX = (newAttrs.width - padding * 2) / pure.width;
|
||||
var scaleY = (newAttrs.height - padding * 2) / pure.height;
|
||||
var scaleX = pure.width ? (newAttrs.width - padding * 2) / pure.width : 1;
|
||||
var scaleY = pure.height
|
||||
? (newAttrs.height - padding * 2) / pure.height
|
||||
: 1;
|
||||
|
||||
var rotation = Konva.getAngle(node.rotation());
|
||||
var dx = pure.x * scaleX - padding - node.offsetX() * scaleX;
|
||||
|
Reference in New Issue
Block a user