Search
Grid.getCellFromPoint Method
See Also
 






Gets the cell located at the specified point.

Namespace: MindFusion.Diagramming.Lanes
File: Grid.js

 Syntax

JavaScript  Copy Code

function getCellFromPoint (point, cellBounds)

 Parameters

point

A Point instance specifying a point within the grid.

cellBounds

An object that receives the coordinates of the found cell in its cellBounds field.

 Return Value

A Cell object identifying the found cell, or null if there is no cell located at the specified point.

 Example

The following example illustrates how to find the cell at a specific position as well as its bounding rectangle:

JavaScript  Copy Code

var boundsResult = {};
var cell = grid.getCellFromPoint(new Point(50, 50), boundsResult);
if (cell)
{
    var cellBounds = boundsResult.cellBounds;
}

 See Also