+ [task#129807] add isSameLine function for think3c widget.

This commit is contained in:
wangzemei
2024-10-13 18:14:10 +08:00
committed by 孙浩
parent 9fe76abf20
commit b8a54a29df
+15
View File
@@ -200,6 +200,21 @@ function calculateCardPosition(region, index)
}
}
/**
* 判断在同一行。
* Judge on the same line.
*
* @param array currentItem
* @param array nextItem
* @param number offset
* @access public
* @return boolean
*/
function isSameLine(currentItem, nextItem, offset)
{
return currentItem[1] == nextItem[1] || Math.abs(currentItem[1] - nextItem[1]) < offset;
}
/**
* 获取最大左侧坐标和最小右侧坐标。
* Get maxLeft and minRight.