MCPcopy
hub / github.com/microsoft/SandDance / _mergeRect

Function _mergeRect

docs/app/js/sanddance-app.js:41435–41443  ·  view source on GitHub ↗
(targetRect, newRect)

Source from the content-addressed store, hash-verified

41433 return innerRect.top >= outerRect.top && innerRect.left >= outerRect.left && innerRect.bottom <= outerRect.bottom && innerRect.right <= outerRect.right;
41434}
41435function _mergeRect(targetRect, newRect) {
41436 targetRect.top = newRect.top < targetRect.top || targetRect.top === -1 ? newRect.top : targetRect.top;
41437 targetRect.left = newRect.left < targetRect.left || targetRect.left === -1 ? newRect.left : targetRect.left;
41438 targetRect.bottom = newRect.bottom > targetRect.bottom || targetRect.bottom === -1 ? newRect.bottom : targetRect.bottom;
41439 targetRect.right = newRect.right > targetRect.right || targetRect.right === -1 ? newRect.right : targetRect.right;
41440 targetRect.width = targetRect.right - targetRect.left + 1;
41441 targetRect.height = targetRect.bottom - targetRect.top + 1;
41442 return targetRect;
41443}
41444
41445},{"tslib":"01Tx1","react":"8ePka","../../Utilities":"2F07a","./List.types":"jqbj1","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"jqbj1":[function(require,module,exports) {
41446var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers 1

_loop_1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected