PDA

View Full Version : [4 B3] Drag drop problem with intersect method of Ext.util.Region



mankz
19 Apr 2011, 11:44 PM
I believe there's a slight bug in the intersect method of Ext.util.Region.

The check for the intersect doesn't include equality:



if (b > t && r > l) {


4 B3 version


intersect : function(region) {
var me = this,
t = Math.max(me.y, region.y),
r = Math.min(me.right, region.right),
b = Math.min(me.bottom, region.bottom),
l = Math.max(me.x, region.x);

if (b > t && r > l) {
return new this.self(t, r, b, l);
}
else {
return false;
}
},


3.x version


intersect : function(region) {
var me = this,
t = Math.max(me.top, region.top),
r = Math.min(me.right, region.right),
b = Math.min(me.bottom, region.bottom),
l = Math.max(me.left, region.left);

if (b >= t && r >= l) {
return new Ext.lib.Region(t, r, b, l);
}
},


This leads to DragZones not working properly for me...

mankz
29 Apr 2011, 2:00 AM
*cough* *burp*