Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMEdit

A high-end code editor for all things GameMaker · By YellowAfterlife

Scrolling jumps 9 lines at a time

A topic by PolyCrunch Games created Dec 09, 2021 Views: 142 Replies: 5
Viewing posts 1 to 2

This tool is awesome, but I couldn't find the setting to tweak the scrolling in the code editor. The scrolling in the Preferences window is perfect, but in any code window it just jumps by 9 lines on minimal scroll, making it uncontrollable to scroll predictably. In Windows OS settings, the mouse scrolling is set to minimum. And as I said, in the Preferences window of the editor it's perfect. Any idea if there's a setting? (I toggled on Animated Scrolling but didn't have an effect).

Developer (1 edit)

Ace (the underlying code editor) uses a very normal approach to element structure (editor is a scrolling box with line elements inside), and Electron (read: Chromium) doesn’t have the same quirk as Firefox does (where scrolling speed is affected by font size) so there is no apparent reason for this to happen.

Does this also happen in
a) Web version of GMEdit (it’s slightly out of date but the starting page should be good to check with)
b) Ace’s demos
?

I tried both web GMEdit, and Ace's demos and both behave the same. They jump by around 9 lines. I thought it was perhaps because of the Magic Mouse, but I tried two other Microsoft common mice, and the behaviour is the same. It just jumps by 9 as soon as I scroll the wheel by one "click". I don't see this behaviour in any other app though. Scrolling behaves normally even in the tree-view of GMEdit.

Developer

If it happens in Ace’s demos, it would be something to report for it along with reproduction steps.

For a workaround, you can try opening ace.js in a text/code editor, finding this bit (around line 1503 as of writing), and editing the factor to be a higher value

    if ("onmousewheel" in el) {
        exports.addListener(el, "mousewheel", function(e) {
            var factor = 8;
            if (e.wheelDeltaX !== undefined) {
                e.wheelX = -e.wheelDeltaX / factor;
                e.wheelY = -e.wheelDeltaY / factor;
            } else {
                e.wheelX = 0;
                e.wheelY = -e.wheelDelta / factor;
            }
            callback(e);
        });

(maybe also add a console.log(e.wheelDeltaX, e.wheelDeltaY, e.wheelDelta) and let me know what the values are)

Perfect! I changed the factor from 8 to 64 and it's working as expected.

I also added the console logs and this a sample of what I was seeing when scrolling:

ace.js:1513 0 -300 -300

ace.js:1513 0 -1200 -1200

ace.js:1513 0 -1500 -1500

ace.js:1513 0 -600 -600

3ace.js:1513 0 -300 -300

ace.js:1513 0 -2400 -2400

ace.js:1513 0 -300 -300

ace.js:1513 0 -900 -900

3ace.js:1513 0 -300 -300

ace.js:1513 0 -1200 -1200

ace.js:1513 0 -300 -300

ace.js:1513 0 -1200 -1200

2ace.js:1513 0 -900 -900

2ace.js:1513 300 0 300

7ace.js:1513 0 300 300

40ace.js:1513 0 -300 -300

ace.js:1513 300 0 300

15ace.js:1513 0 -300 -300

ace.js:1513 300 0 300

Do you think I should still report the issue in the link you provided?

Developer

I think it’s worth reporting, though this may also be on Mac side - a normal value for scrolling amount is supposed to be in 100..200 range (most commonly 120), not up to 1500.