-
Notifications
You must be signed in to change notification settings - Fork 150
Interface Issue: Uncontrollably Fast Zoom In and Out #62
Comments
Hi @ArgosOz, thanks for the bug report! The editor camera controls are located in https://github.com/superpowers/superpowers-game/blob/master/SupEngine/src/components/Camera2DControls.ts and https://github.com/superpowers/superpowers-game/blob/master/SupEngine/src/components/Camera3DControls.ts We don't have a Magic Trackpad so you're probably in the best position to diagnose and submit a fix, but we're willing to help if you have questions, of course. Looking at this line, it looks like numpad plus and minus already allow zooming in and out. |
Hi @elisee,
Indeed it is :) Great. I'd like to add an option for Mac users to use the function with cmd key, later sometime... Currently it uses control key and it works well enough. I appreciate your work. |
I am also having this issue on a Windows 10 laptop. Pinch to zoom however does work well, zooming at a much better speed. A workaround to this problem could be adding a toggle to make the two finger swipes pan the view rather than zooming? (Something I also noted is that horizontal two finger swipe also zooms rather than pans) |
I think I have a solution for this and happy to make a PR. The problem is twofolds:
A way to tackle this could be in private onMouseWheelRealTime = (event: MouseWheelEvent) => {
event.preventDefault();
this.newScrollDelta = 0;
if ((event.wheelDelta || event.detail) !== 0) {
this.newScrollDelta = (event.wheelDelta > 0 || event.detail < 0) ? 1 : -1;
}
return false;
};
private onMouseWheel = throttle(this.onMouseWheelRealTime, 100); Ideally, This seems to work for me and doesn't seem to impact the mouse (the 100 value can be tweaked but I think not under 75 if it's a little more sluggish). My concern was around modifying the Otherwise, in Let me know what you prefer and I can put together a PR. |
@elisee Hey! I'm keen to get this fixed quickly so I can really use the editor to its fullest. Is there anything I can do to speed up the process? |
@MathieuLoutre I will take a look at it soon. Feel free to submit a PR, even if we end up doing it differently, it's always useful to have a starting point! |
Great! Thanks! Will see if I can wrestle something this evening or tomorrow. |
@elisee I've made the PR on |
Closing this in favor of superpowers/superpowers-game#123 and superpowers/superpowers-game#132 since this is related to Superpowers Game. |
GIF representation of the Problem: https://gfycat.com/QuaintArcticHoki
Two finger swipe on Apple Magic Trackpad emulates mouse wheel's up and down movement. Zoomable editor screens moves too fast in and out if you use a Magic Trackpad. No superpowers with a Magic Trackpad, in other words, it's like kryptonite :)
I'm willing to find a solution but I don't know where to look in the code... any suggestions? This may be a Chromium problem though it feels better in Google Chrome Canary and worst in Electron. If this is a problem out of our reach... I mean, I wouldn't want to mess with Chromium code...
Could you please introduce an alternative control scheme for zooming in an out? Like: cmd + plus and cmd + minus.
The text was updated successfully, but these errors were encountered: