Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: WebKit/chromium/src/win/WebInputEventFactory.cpp

Issue 3364013: Merge 67001 - 2010-09-08 Peter Kasting <pkasting@google.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « WebKit/chromium/src/WebScrollbarImpl.cpp ('k') | WebKit/qt/Api/qwebframe.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006-2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 // Convert wheel delta amount to a number of pixels to scroll. 397 // Convert wheel delta amount to a number of pixels to scroll.
398 // 398 //
399 // How many pixels should we scroll per line? Gecko uses the height of the 399 // How many pixels should we scroll per line? Gecko uses the height of the
400 // current line, which means scroll distance changes as you go through the 400 // current line, which means scroll distance changes as you go through the
401 // page or go to different pages. IE 8 is ~60 px/line, although the value 401 // page or go to different pages. IE 8 is ~60 px/line, although the value
402 // seems to vary slightly by page and zoom level. Also, IE defaults to 402 // seems to vary slightly by page and zoom level. Also, IE defaults to
403 // smooth scrolling while Firefox doesn't, so it can get away with somewhat 403 // smooth scrolling while Firefox doesn't, so it can get away with somewhat
404 // larger scroll values without feeling as jerky. Here we use 100 px per 404 // larger scroll values without feeling as jerky. Here we use 100 px per
405 // three lines (the default scroll amount is three lines per wheel tick). 405 // three lines (the default scroll amount is three lines per wheel tick).
406 // Even though we have smooth scrolling, we don't make this as large as IE
407 // because subjectively IE feels like it scrolls farther than you want while
408 // reading articles.
406 static const float scrollbarPixelsPerLine = 100.0f / 3.0f; 409 static const float scrollbarPixelsPerLine = 100.0f / 3.0f;
407 wheelDelta /= WHEEL_DELTA; 410 wheelDelta /= WHEEL_DELTA;
408 float scrollDelta = wheelDelta; 411 float scrollDelta = wheelDelta;
409 if (horizontalScroll) { 412 if (horizontalScroll) {
410 unsigned long scrollChars = defaultScrollCharsPerWheelDelta; 413 unsigned long scrollChars = defaultScrollCharsPerWheelDelta;
411 SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scrollChars, 0); 414 SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scrollChars, 0);
412 // TODO(pkasting): Should probably have a different multiplier 415 // TODO(pkasting): Should probably have a different multiplier
413 // scrollbarPixelsPerChar here. 416 // scrollbarPixelsPerChar here.
414 scrollDelta *= static_cast<float>(scrollChars) * scrollbarPixelsPerLine; 417 scrollDelta *= static_cast<float>(scrollChars) * scrollbarPixelsPerLine;
415 } else { 418 } else {
(...skipping 12 matching lines...) Expand all
428 result.wheelTicksX = wheelDelta; 431 result.wheelTicksX = wheelDelta;
429 } else { 432 } else {
430 result.deltaY = scrollDelta; 433 result.deltaY = scrollDelta;
431 result.wheelTicksY = wheelDelta; 434 result.wheelTicksY = wheelDelta;
432 } 435 }
433 436
434 return result; 437 return result;
435 } 438 }
436 439
437 } // namespace WebKit 440 } // namespace WebKit
OLDNEW
« no previous file with comments | « WebKit/chromium/src/WebScrollbarImpl.cpp ('k') | WebKit/qt/Api/qwebframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698