flowhub / the-graph

SVG custom elements for FBP graph editing and visualization. Used in noflo/noflo-ui
https://flowhub.github.io/the-graph/demo-full.html
MIT License
1.01k stars 180 forks source link

Nav minimap can't drag properly #624

Open linonetwo opened 11 months ago

linonetwo commented 11 months ago

When drag on minimap, the drag delta xy is calculated from the distance from the origin dragstart event point, so it feels like it is drifting. Caused by https://github.com/hammerjs/hammer.js/issues/806

Current workaround https://github.com/flowhub/the-graph/issues/623#issuecomment-1635184381

      const speedupFactorX = this.props.viewrectangle[2] / this.props.width * 2;
      const speedupFactorY = this.props.viewrectangle[3] / this.props.height * 2;

Note that the 2 magic number here is what I test suit for my app size. I thought this.props.viewrectangle[2] / this.props.width is enough, but it is not, don't know why...