MCPcopy Index your code
hub / github.com/microsoft/SandDance / getUniqueObjects

Function getUniqueObjects

docs/app/js/sanddance-app.js:92032–92052  ·  view source on GitHub ↗
(_ref2)

Source from the content-addressed store, hash-verified

92030 return NO_PICKED_OBJECT;
92031}
92032function getUniqueObjects(_ref2) {
92033 var pickedColors = _ref2.pickedColors, layers = _ref2.layers;
92034 var uniqueColors = new Map();
92035 if (pickedColors) for(var i = 0; i < pickedColors.length; i += 4){
92036 var pickedLayerIndex = pickedColors[i + 3] - 1;
92037 if (pickedLayerIndex >= 0) {
92038 var pickedColor = pickedColors.slice(i, i + 4);
92039 var colorKey = pickedColor.join(",");
92040 if (!uniqueColors.has(colorKey)) {
92041 var pickedLayer = layers[pickedLayerIndex];
92042 if (pickedLayer) uniqueColors.set(colorKey, {
92043 pickedColor: pickedColor,
92044 pickedLayer: pickedLayer,
92045 pickedObjectIndex: pickedLayer.decodePickingColor(pickedColor)
92046 });
92047 else (0, _logDefault.default).error("Picked non-existent layer. Is picking buffer corrupt?")();
92048 }
92049 }
92050 }
92051 return Array.from(uniqueColors.values());
92052}
92053
92054},{"../../utils/log":"1biSe","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"lUcJO":[function(require,module,exports) {
92055var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers

nothing calls this directly

Calls 4

hasMethod · 0.45
setMethod · 0.45
errorMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected