* @function LevelRenderer.Tool.Areal.prototype._buildPathMethod * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。 * @param {Object} shape - 图形。 * @param {Object} context - 上下文。 * @param {number} area - 目标区域。 * @param {number} x - 横坐标。 * @param {number} y -
(shape, context, area, x, y)
| 388 | * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。 |
| 389 | */ |
| 390 | _buildPathMethod(shape, context, area, x, y) { |
| 391 | // 图形类实现路径创建了则用类的path |
| 392 | context.beginPath(); |
| 393 | shape.buildPath(context, area); |
| 394 | context.closePath(); |
| 395 | return context.isPointInPath(x, y); |
| 396 | } |
| 397 | |
| 398 | /** |
| 399 | * @function LevelRenderer.Tool.Areal.prototype.isOutside |