Comments (16)
I have also found it to be too fast, at least in the webkit based browsers I use.
from ace.
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.
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.
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.
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.
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.
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.
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.
Sweet! Thanks.
from ace.
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.
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.
Scrolling is also epic fast in Titanium Desktop, which uses a webkit engine.
from ace.
Is there a temporary workaround to slow down scroll speed? Thanks.
from ace.
Also, note that scrolling grinds to a halt after a moment of scrolling in Adobe AIR. Mentioned in Issue #401.
from ace.
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.
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)
- SplitEditor not showing annotations HOT 1
- Editor can't enter a newline before a JSDoc comment HOT 1
- CSS Mode support for CSS Nesting HOT 2
- CSS Worker support for CSS Nesting HOT 3
- Add project (project name) to the list of projects using Ace on its website
- (lua): '=' expected near '::' HOT 2
- Desktop Safari: Editor background color doesn't update consistently after switching theme HOT 4
- (default_gutter_handler): showTooltip is CSP incompliant - assigns innerHTML HOT 2
- Ability to instantiate editor without theme HOT 4
- Add project Gamaddy to the list of projects using Ace on its website
- touch_handler: Hide actions that are not available HOT 2
- Vue mode: incorrect processing of colon in attributes HOT 2
- latex: (bright) GitHub theme only black and with only a few commands highlighted HOT 3
- ååįžčū HOT 5
- JSDoc `@param` not detected / wrong coloring
- (c_cpp_highlight_rules): (Separate Syntax Highlighting for C++ and Objective C)
- core: resize missbehaviour HOT 4
- Opensolr.com HOT 1
- pinkcoding HOT 6
- mycoderseven HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
ð Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google âĪïļ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ace.