mirror of
https://github.com/konvajs/konva.git
synced 2025-09-21 04:27:56 +08:00
@@ -1,3 +1,11 @@
|
|||||||
|
## 0.7.1
|
||||||
|
|
||||||
|
* Bug Fixes
|
||||||
|
* fixed when browser is crashing on pointer events fixed (and optimized `getIntersection` function)
|
||||||
|
* Enhancements
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Rebranding release 2015-01-28 (Differents from last official KineticJS release)
|
## Rebranding release 2015-01-28 (Differents from last official KineticJS release)
|
||||||
|
|
||||||
* Bug Fixes
|
* Bug Fixes
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "konva",
|
"name": "konva",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Eric Rowell", "Anton Lavrenov"
|
"Eric Rowell", "Anton Lavrenov"
|
||||||
],
|
],
|
||||||
|
27
konva.js
27
konva.js
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Konva JavaScript Framework v0.7.0
|
* Konva JavaScript Framework v0.7.1
|
||||||
* http://konvajs.github.io/
|
* http://konvajs.github.io/
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: 2015-01-28
|
* Date: 2015-01-29
|
||||||
*
|
*
|
||||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||||
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
|
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
|
||||||
@@ -36,7 +36,7 @@ var Konva = {};
|
|||||||
|
|
||||||
Konva = {
|
Konva = {
|
||||||
// public
|
// public
|
||||||
version: '0.7.0',
|
version: '0.7.1',
|
||||||
|
|
||||||
// private
|
// private
|
||||||
stages: [],
|
stages: [],
|
||||||
@@ -10244,8 +10244,12 @@ var Konva = {};
|
|||||||
}
|
}
|
||||||
// we should continue search if we found antialiased pixel
|
// we should continue search if we found antialiased pixel
|
||||||
// that means our node somewhere very close
|
// that means our node somewhere very close
|
||||||
else if (obj.antialiased) {
|
else {
|
||||||
continueSearch = true;
|
continueSearch = !!obj.antialiased;
|
||||||
|
// stop search if found empty pixel
|
||||||
|
if (!obj.antialiased) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if no shape, and no antialiased pixel, we should end searching
|
// if no shape, and no antialiased pixel, we should end searching
|
||||||
@@ -10284,9 +10288,16 @@ var Konva = {};
|
|||||||
if(p3 === 255) {
|
if(p3 === 255) {
|
||||||
colorKey = Konva.Util._rgbToHex(p[0], p[1], p[2]);
|
colorKey = Konva.Util._rgbToHex(p[0], p[1], p[2]);
|
||||||
shape = Konva.shapes[HASH + colorKey];
|
shape = Konva.shapes[HASH + colorKey];
|
||||||
return {
|
if (shape) {
|
||||||
shape: shape
|
return {
|
||||||
};
|
shape: shape
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
antialiased: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// antialiased pixel
|
// antialiased pixel
|
||||||
else if(p3 > 0) {
|
else if(p3 > 0) {
|
||||||
|
6
konva.min.js
vendored
6
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "konva",
|
"name": "konva",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"author": "Anton Lavrenov",
|
"author": "Anton Lavrenov",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "1.9.2",
|
"chai": "1.9.2",
|
||||||
|
21
src/Layer.js
21
src/Layer.js
@@ -75,8 +75,12 @@
|
|||||||
}
|
}
|
||||||
// we should continue search if we found antialiased pixel
|
// we should continue search if we found antialiased pixel
|
||||||
// that means our node somewhere very close
|
// that means our node somewhere very close
|
||||||
else if (obj.antialiased) {
|
else {
|
||||||
continueSearch = true;
|
continueSearch = !!obj.antialiased;
|
||||||
|
// stop search if found empty pixel
|
||||||
|
if (!obj.antialiased) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if no shape, and no antialiased pixel, we should end searching
|
// if no shape, and no antialiased pixel, we should end searching
|
||||||
@@ -115,9 +119,16 @@
|
|||||||
if(p3 === 255) {
|
if(p3 === 255) {
|
||||||
colorKey = Konva.Util._rgbToHex(p[0], p[1], p[2]);
|
colorKey = Konva.Util._rgbToHex(p[0], p[1], p[2]);
|
||||||
shape = Konva.shapes[HASH + colorKey];
|
shape = Konva.shapes[HASH + colorKey];
|
||||||
return {
|
if (shape) {
|
||||||
shape: shape
|
return {
|
||||||
};
|
shape: shape
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
antialiased: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// antialiased pixel
|
// antialiased pixel
|
||||||
else if(p3 > 0) {
|
else if(p3 > 0) {
|
||||||
|
@@ -751,6 +751,54 @@ suite('MouseEvents', function() {
|
|||||||
});
|
});
|
||||||
assert.equal(groupMousedowns, 1, 'groupMousedowns should be 1');
|
assert.equal(groupMousedowns, 1, 'groupMousedowns should be 1');
|
||||||
});
|
});
|
||||||
|
test('test mousemove events with antialiasing', function() {
|
||||||
|
var stage = addStage();
|
||||||
|
var layer = new Konva.Layer();
|
||||||
|
|
||||||
|
var group = new Konva.Group({
|
||||||
|
name: 'group'
|
||||||
|
});
|
||||||
|
var rect1 = new Konva.Rect({
|
||||||
|
x:0,
|
||||||
|
y:0,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
fill: 'red'
|
||||||
|
});
|
||||||
|
|
||||||
|
var rect2 = new Konva.Rect({
|
||||||
|
x:50,
|
||||||
|
y:0,
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
rotation: 45,
|
||||||
|
fill: 'green'
|
||||||
|
});
|
||||||
|
group.add(rect1).add(rect2);
|
||||||
|
layer.add(group);
|
||||||
|
group.cache({
|
||||||
|
width : rect1.width(),
|
||||||
|
height : rect1.height()
|
||||||
|
});
|
||||||
|
group.scaleX(5);
|
||||||
|
group.scaleY(5);
|
||||||
|
var mouseenterCount = 0;
|
||||||
|
group.on('mouseenter', function() {
|
||||||
|
mouseenterCount++;
|
||||||
|
});
|
||||||
|
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
var top = stage.content.getBoundingClientRect().top;
|
||||||
|
// move mouse slowly
|
||||||
|
for (var i = 99; i < 129; i++) {
|
||||||
|
stage._mousemove({
|
||||||
|
clientX: i,
|
||||||
|
clientY: 135 + top
|
||||||
|
});
|
||||||
|
}
|
||||||
|
assert.equal(mouseenterCount, 1, 'mouseenterCount should be 1');
|
||||||
|
});
|
||||||
|
|
||||||
// ======================================================
|
// ======================================================
|
||||||
test('group mouseenter events', function(done) {
|
test('group mouseenter events', function(done) {
|
||||||
|
Reference in New Issue
Block a user