retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

Editor display flips upside down sometimes when zooming in and out #446

Closed iskandarreza closed 1 year ago

iskandarreza commented 4 years ago

Background: When I'm double-clicking on a node, the editor zooms in really close to the node. So I zoom out and sometimes it zooms out really fast and really far out. Then when I try to zoom back in/out quickly the whole editor flips upside down.

tombasche commented 3 years ago

I can confirm this also happens when just zooming out really quickly with the mousewheel. Has there been any traction on this? Happy to take a look if there's been no movement.

I suspect something is negated in the viewport without being handled correctly

noxz-dev commented 3 years ago

got the same problem any news ?

tombasche commented 3 years ago

got the same problem any news ?

I get the feeling this repository is somewhat abandoned; last commit was 6 months ago...

noxz-dev commented 3 years ago

yeah got the same feeling

this patch fixes the problem:


const fs = require('fs');
const path = require('path');

const loadRetePath = path.resolve(__dirname, '../node_modules/rete/build/rete.esm.js');

fs.writeFileSync(
  loadRetePath,
  fs
    .readFileSync(loadRetePath, 'utf8')
    .replace(
      'var delta = (wheelDelta ? wheelDelta / 120 : -e.deltaY / 3) * this.intensity;',
      'var delta = (wheelDelta ? wheelDelta / 120 : -e.deltaY / 50) * this.intensity;',
    ),
);
becausemirbek commented 3 years ago

yeah got the same feeling

this patch fixes the problem:

const fs = require('fs');
const path = require('path');

const loadRetePath = path.resolve(__dirname, '../node_modules/rete/build/rete.esm.js');

fs.writeFileSync(
  loadRetePath,
  fs
    .readFileSync(loadRetePath, 'utf8')
    .replace(
      'var delta = (wheelDelta ? wheelDelta / 120 : -e.deltaY / 3) * this.intensity;',
      'var delta = (wheelDelta ? wheelDelta / 120 : -e.deltaY / 50) * this.intensity;',
    ),
);

where should i write this code?

i have react-app where i use rete js

noxz-dev commented 3 years ago

its a postinstall patch so you have to run it after npm install

example (package.json):

"scripts": {
    "postinstall": "node ./scripts/rete-patch.js"
  },
becausemirbek commented 3 years ago

its a postinstall patch so you have to run it after npm install

example (package.json):

"scripts": {
    "postinstall": "node ./scripts/rete-patch.js"
  },

Thanks!

rete-js[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.