Giter Club home page Giter Club logo

Comments (16)

leftshoe avatar leftshoe commented on August 25, 2024

I have also found it to be too fast, at least in the webkit based browsers I use.

from ace.

defunkt avatar defunkt commented on August 25, 2024

Scrolling in Chrome now feels more normal, but Safari is still very fast. Was something done specifically to fix Chrome, and could that work for Safari as well?

from ace.

fjakobs avatar fjakobs commented on August 25, 2024

I did not change the code but I guess they change the scroll speed in Chrome. Will see what a good scroll factor is for Safari.

https://github.com/ajaxorg/pilot/blob/master/lib/pilot/event.js#L174
https://github.com/ajaxorg/pilot/blob/master/lib/pilot/event.js#L183

from ace.

fjakobs avatar fjakobs commented on August 25, 2024

the relevant qooxdoo code as reference

    getWheelDelta : qx.core.Variant.select("qx.client",
    {
      "default" : function() {
        return -(this._native.wheelDelta / 40);
      },

      "gecko" : function() {
        return this._native.detail;
      },

      "webkit" : function()
      {
        if (qx.bom.client.Browser.NAME == "chrome") {
          // mac has a much higher sppedup during scrolling
          if (qx.bom.client.Platform.MAC) {
            return -(this._native.wheelDelta / 1200);
          } else {
            return -(this._native.wheelDelta / 120);
          }


        } else {
          // windows safaris behave different than on OSX
          if (qx.bom.client.Platform.WIN) {
            var factor = 120;
            // safari 5.0 and not 5.0.1
            if (qx.bom.client.Engine.VERSION == 533.16) {
              factor = 1200;
            }
          } else {
            factor = 40;
            // Safari 5.0 or 5.0.1
            if (qx.bom.client.Engine.VERSION == 533.16 || qx.bom.client.Engine.VERSION == 533.17) {
              factor = 1200;
            }
          }
          return -(this._native.wheelDelta / factor);
        }
      }
    })

from ace.

defunkt avatar defunkt commented on August 25, 2024

Had a look at this today. Here's the value of e.wheelDeltaY while scrolling in Safari and Chrome.

Safari 5.0.5 (6533.21.1)

Chrome 13.0.782.112

Pretty big difference. Changing the 8 to 800 at https://github.com/ajaxorg/pilot/blob/master/lib/pilot/event.js#L175 makes Safari's scroll rate slow down to be in the ballpark of Chrome's.

Perhaps some sort of conditional is needed? Or is there a better way to handle things like this.

from ace.

fjakobs avatar fjakobs commented on August 25, 2024

Interestingly it is fixed in Safari 5.1 (7534.48.3). I think your fix is fine since Safari 5 almost always reports numbers above 800 and no other browser ever reaches 800.

from ace.

defunkt avatar defunkt commented on August 25, 2024

I noticed that the initial scroll can still be a bit too fast. I think this is due to e.wheelDeltaY sometimes being negative.

This seems to fix it:

if (Math.abs(e.wheelDeltaY) > max)
    max = Math.abs(e.wheelDeltaY)

from ace.

fjakobs avatar fjakobs commented on August 25, 2024

I've just made exactly this change. Also I had to increase the threshold since Chrome could exceed the threshold and then scrolling became really slow.

https://github.com/ajaxorg/pilot/commit/b60e9954e67887a01abc12a56db1e11495ef961d

from ace.

defunkt avatar defunkt commented on August 25, 2024

Sweet! Thanks.

from ace.

Ciantic avatar Ciantic commented on August 25, 2024

Now it's opposite, too slow.

Running Chrome 15.0.874.92 beta-m the scroll wheel step is now two lines at a time, it takes ages to scroll the document. When my Windows 7 native is around 8 lines, which works just fine elsewhere in Chrome.

Why is OS default scroll stepping even being tampered with?

from ace.

fjakobs avatar fjakobs commented on August 25, 2024

We have to normalize the scroll speed and direction because some browsers (esp. some versions of Safari) report numbers which are an order of magnitude higher than normal. Take a look at the numbers above. However I think I tried to be too smart. I'll take a look into this again.

from ace.

matthew-dean avatar matthew-dean commented on August 25, 2024

Scrolling is also epic fast in Titanium Desktop, which uses a webkit engine.

from ace.

matthew-dean avatar matthew-dean commented on August 25, 2024

Is there a temporary workaround to slow down scroll speed? Thanks.

from ace.

matthew-dean avatar matthew-dean commented on August 25, 2024

Also, note that scrolling grinds to a halt after a moment of scrolling in Adobe AIR. Mentioned in Issue #401.

from ace.

Ciantic avatar Ciantic commented on August 25, 2024

Thing I don't get it is why they even tamper the OS Wheel stepping setting? Can't they just leave it alone?

from ace.

nightwing avatar nightwing commented on August 25, 2024

There are multiple issues reported here without clear steps to reproduce and mostly for very old browsers. I think it's better to close this issue, so that when there are new issues related to scrolling, they can be reported in separate threads where it will be much easier to reproduce and fix.

@Ciantic they need to "tamper the OS Wheel" to make virtual viewport work, without which editor would be very slow.

from ace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google âĪïļ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.