UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

24 lines (20 loc) 699 B
/** * Copyright IBM Corp. 2020, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; const getSelectionAreaPoints = area => { const greatestRowIndex = Math.max(area.point1.row, area.point2.row); const greatestColumnIndex = Math.max(area.point1.column, area.point2.column); const lowestRowIndex = Math.min(area.point1.row, area.point2.row); const lowestColumnIndex = Math.min(area.point1.column, area.point2.column); return { greatestRowIndex, greatestColumnIndex, lowestColumnIndex, lowestRowIndex }; }; exports.getSelectionAreaPoints = getSelectionAreaPoints;