mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
fix wrong Path
getClientRect()
calculation
This commit is contained in:
parent
e3596d6c63
commit
e54b378a33
@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Fixed
|
||||
- repair `cancelBubble` event property behaviour
|
||||
- fix wrong `Path` `getClientRect()` calculation
|
||||
|
||||
## [0.11.1][2016-01-16]
|
||||
|
||||
|
6
konva.js
6
konva.js
@ -3,7 +3,7 @@
|
||||
* Konva JavaScript Framework v0.11.1
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: Tue Jan 26 2016
|
||||
* Date: Fri Feb 05 2016
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
|
||||
@ -14157,8 +14157,8 @@
|
||||
});
|
||||
var minX = points[0];
|
||||
var maxX = points[0];
|
||||
var minY = points[0];
|
||||
var maxY = points[0];
|
||||
var minY = points[1];
|
||||
var maxY = points[1];
|
||||
var x, y;
|
||||
for (var i = 0; i < points.length / 2; i++) {
|
||||
x = points[i * 2]; y = points[i * 2 + 1];
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -99,8 +99,8 @@
|
||||
});
|
||||
var minX = points[0];
|
||||
var maxX = points[0];
|
||||
var minY = points[0];
|
||||
var maxY = points[0];
|
||||
var minY = points[1];
|
||||
var maxY = points[1];
|
||||
var x, y;
|
||||
for (var i = 0; i < points.length / 2; i++) {
|
||||
x = points[i * 2]; y = points[i * 2 + 1];
|
||||
|
@ -869,4 +869,20 @@ suite('Path', function() {
|
||||
assert.equal(hitTrace, 'clearRect(0,0,578,200);save();transform(1,0,0,1,0,0);beginPath();moveTo(50,0);bezierCurveTo(50,150,170,170,200,170);lineWidth=2;strokeStyle=black;stroke();restore();');
|
||||
});
|
||||
|
||||
it('getClientRect', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
|
||||
var path = new Konva.Path({
|
||||
data: 'M61.55,184.55 60.55,280.55 164.55,284.55 151.55,192.55 Z',
|
||||
fill: 'black',
|
||||
stroke: 'red'
|
||||
});
|
||||
layer.add(path);
|
||||
var rect = path.getClientRect();
|
||||
assert.deepEqual(rect, {x: 60, y: 184, width: 106, height: 102});
|
||||
})
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user