(updateParams: UpdateParameters<Layer<PropsT>>, forceUpdate: boolean)
| 1258 | /** Called after updateState to perform common tasks */ |
| 1259 | // eslint-disable-next-line complexity |
| 1260 | protected _postUpdate(updateParams: UpdateParameters<Layer<PropsT>>, forceUpdate: boolean) { |
| 1261 | const {props, oldProps} = updateParams; |
| 1262 | |
| 1263 | // Note: Automatic instance count update only works for single layers |
| 1264 | const model = this.state.model as Model | undefined; |
| 1265 | if (model?.isInstanced) { |
| 1266 | model.setInstanceCount(this.getNumInstances()); |
| 1267 | } |
| 1268 | |
| 1269 | // Set picking module parameters to match props |
| 1270 | const {autoHighlight, highlightedObjectIndex, highlightColor} = props; |
| 1271 | if ( |
| 1272 | forceUpdate || |
| 1273 | oldProps.autoHighlight !== autoHighlight || |
| 1274 | oldProps.highlightedObjectIndex !== highlightedObjectIndex || |
| 1275 | oldProps.highlightColor !== highlightColor |
| 1276 | ) { |
| 1277 | const picking: PickingProps = {}; |
| 1278 | |
| 1279 | if (Array.isArray(highlightColor)) { |
| 1280 | picking.highlightColor = highlightColor as [number, number, number]; |
| 1281 | } |
| 1282 | |
| 1283 | // highlightedObjectIndex will overwrite any settings from auto highlighting. |
| 1284 | // Do not reset unless the value has changed. |
| 1285 | if ( |
| 1286 | forceUpdate || |
| 1287 | oldProps.autoHighlight !== autoHighlight || |
| 1288 | highlightedObjectIndex !== oldProps.highlightedObjectIndex |
| 1289 | ) { |
| 1290 | picking.highlightedObjectColor = |
| 1291 | Number.isFinite(highlightedObjectIndex) && (highlightedObjectIndex as number) >= 0 |
| 1292 | ? this.encodePickingColor(highlightedObjectIndex) |
| 1293 | : null; |
| 1294 | } |
| 1295 | |
| 1296 | this.setShaderModuleProps({picking}); |
| 1297 | } |
| 1298 | } |
| 1299 | |
| 1300 | private _getUpdateParams(): UpdateParameters<Layer<PropsT>> { |
| 1301 | return { |
nothing calls this directly
no test coverage detected
searching dependent graphs…