Commit 08f6a8dd authored by techird's avatar techird

fix drop test issue

parent 217e0408
......@@ -40,7 +40,7 @@
<div id="kityminder" onselectstart="return false"></div>
<div id="share-dialog" >
<div id="share-dialog">
<h3>URL分享:</h3>
<p>
<input id="share-url" type="url" value="http://naotu.baidu.com/?shareId=kcev3dd" />
......
......@@ -300,7 +300,12 @@ var TreeDragger = kity.createClass('TreeDragger', {
function area(box) {
return box.width * box.height;
}
return intersectBox && area(intersectBox) > 0.5 * Math.min(area(sourceBox), area(targetBox), 1e4);
if (!intersectBox) return false;
// 面积判断
if (area(intersectBox) > 0.5 * Math.min(area(sourceBox), area(targetBox))) return true;
if (intersectBox.width + 1 >= Math.min(sourceBox.width, targetBox.width)) return true;
if (intersectBox.height + 1 >= Math.min(sourceBox.height, targetBox.height)) return true;
return false;
});
this._renderDropHint(this._dropSucceedTarget);
return !!this._dropSucceedTarget;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment