MCPcopy Create free account
hub / github.com/microsoft/SandDance / getObjectHighlightParameters

Function getObjectHighlightParameters

docs/tests/v2/es6/js/sanddance.js:45327–45343  ·  view source on GitHub ↗

* Returns the picking color of currenlty selected object of the given 'layer'. * @return {Array} - the picking color or null if layers selected object is invalid.

(layer)

Source from the content-addressed store, hash-verified

45325
45326
45327function getObjectHighlightParameters(layer) {
45328 // TODO - inefficient to update settings every render?
45329 // TODO: Add warning if 'highlightedObjectIndex' is > numberOfInstances of the model.
45330 var _layer$props = layer.props,
45331 highlightedObjectIndex = _layer$props.highlightedObjectIndex,
45332 highlightColor = _layer$props.highlightColor;
45333 var parameters = {
45334 pickingHighlightColor: [highlightColor[0], highlightColor[1], highlightColor[2], highlightColor[3] || 255]
45335 }; // Update picking module settings if highlightedObjectIndex is set.
45336 // This will overwrite any settings from auto highlighting.
45337
45338 if (Number.isInteger(highlightedObjectIndex)) {
45339 parameters.pickingSelectedColor = highlightedObjectIndex >= 0 ? layer.encodePickingColor(highlightedObjectIndex) : null;
45340 }
45341
45342 return parameters;
45343}
45344},{"luma.gl/constants":"zLGf","luma.gl":"iiNl","../utils/log":"mqAj","../utils/assert":"R2tg"}],"uOUz":[function(require,module,exports) {
45345"use strict";
45346

Callers 1

drawLayerInViewportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected