[go: up one dir, main page]

DrawTool: aborting creation of a shape does not stop the onTemporaryPointMoved callback to be called

ℹ️ Funded by an industrial customer.

Summary

If the signal passed to DrawTool.createShape() is aborted, then event listeners registered during creation are not unregistered, and the onTemporaryPointMoved keeps being called whenever the mouse is moving.

Steps to reproduce

  1. Create a shape with the drawtool, and pass an AbortSignal as well as the the onTemporaryPointMoved callback:
const controller = new AbortController();
drawTool.createSegment({ signal: controller.signal, onTemporaryPointMoved: () => console.log('callback called!') });
  1. Abort the signal with controller.abort()
  2. Move the mouse around

Expected behaviour:

The callback is not called.

Actual behaviour:

The callback is called.

Informations

  • Giro3D version: 0.39
  • Browser (Firefox, Chrome, Opera, Safari...) and version: N/A
  • OS (Linux, MacOS, Windows...) N/A

Screenshots

Edited by Sébastien Guimmara