codemirror-interact icon indicating copy to clipboard operation
codemirror-interact copied to clipboard

Package seems to only support updating by an integer value (can't divide e.movementX).

Open zachwinter opened this issue 11 months ago • 1 comments

image

onDrag: (text, setText, e) => {
  const newVal = Number(text) + (e.movementX / 20);
  if (isNaN(newVal)) return;
  setText(newVal.toString());
},

When trying to update a numeric value by a decimal value, it still adds the ending decimal point to the final value.

Absolutely love this feature, but it'd be immeasurably more helpful if I could update more granularly! Especially with a viewport normalized to [-1, 1] on both axes (I'm using GLSL to write fragment shaders).

zachwinter avatar Jul 18 '23 22:07 zachwinter