Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Js fixes #286

Closed
wants to merge 5 commits into from
Closed

Js fixes #286

wants to merge 5 commits into from

Conversation

cr1901
Copy link
Contributor

@cr1901 cr1901 commented Aug 30, 2017

This pull request fixes bugs in the THREE.js viewer, including:

  • mousemove handler no longer relies on event.button having a valid value (per MDN, it was a happy accident that the handler ever worked).
  • HiDPI display controls (or displays where physical pixels do not correspond to a CSS/browser pixel) are fixed.
  • JS has been linted.

I have verified the fixes work on Windows. Please let me know whether a freshly compiled Solvespace exports the fixed viewer before accepting.

@whitequark whitequark force-pushed the master branch 3 times, most recently from 371f33b to fb1065d Compare July 12, 2018 20:24
Copy link
Contributor

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

There's just one more issue I can see: after releasing two fingers after a pinch gesture, the model starts to rotate and this can result in a strange jerk. Do you think you can fix this easily?

.multiplyScalar(1 / object.zoomScale);
object.rotate(-0.3 * Math.PI / 180 * incDiff.x * object.zoomScale,
-0.3 * Math.PI / 180 * incDiff.y * object.zoomScale);
_changed = true;
_rotatePrev.copy(_rotateCur);
}

/* eslint-disable no-unused-vars */
function panstart(event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be replaced with e.g. function panstart(_event) { ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would think this would be simple, and eslint has an argsIgnorePattern option, but it doesn't work for functions only taking one argument.

The correct way to handle this case is create a custom rule. This implies creating a plugin, which is a node package, and also supplying my .eslintrc (which I prob should supply anyway in the repo, since the linter requires it). I don't actually have node installed atm tho- eslint is provided through atom. So, it's a bit of work :(.

Even as-is, I can reduce the scope of the lint disables by doing the following for each event handler:

    /* eslint-disable no-unused-vars */
    function panstart(_event) {
    /* eslint-enable no-unused-vars */
        /* TODO: Dynamically enable pan function? */
        _rotateOrig.copy(_rotateCur);
    }

@whitequark
Copy link
Contributor

There's just one more issue I can see: after releasing two fingers after a pinch gesture, the model starts to rotate and this can result in a strange jerk. Do you think you can fix this easily?

Friendly ping--have you had any time to look at this issue?

@cr1901
Copy link
Contributor Author

cr1901 commented Feb 11, 2019

Friendly ping--have you had any time to look at this issue?
Not much. The issue doesn't appear in the touchscreen emulation of hammer.js, so I need to hook up my phone to Chrome's console and enable remote debugging. I haven't gotten around to doing that.

@whitequark
Copy link
Contributor

Merged manually, thanks.

@whitequark whitequark closed this May 13, 2019
@cr1901
Copy link
Contributor Author

cr1901 commented May 13, 2019

There's just one more issue I can see: after releasing two fingers after a pinch gesture, the model starts to rotate and this can result in a strange jerk. Do you think you can fix this easily?

Is this issue still there? I can't fix right now for reasons I discussed, but I'm happy to try once I'm a bit better.

@whitequark
Copy link
Contributor

Yeah, still there in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants