OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // By default, we assume that gestures don't deselect the scrollbar. | 385 // By default, we assume that gestures don't deselect the scrollbar. |
386 return true; | 386 return true; |
387 } | 387 } |
388 } | 388 } |
389 | 389 |
390 void Scrollbar::mouseMoved(const PlatformMouseEvent& evt) | 390 void Scrollbar::mouseMoved(const PlatformMouseEvent& evt) |
391 { | 391 { |
392 if (m_pressedPart == ThumbPart) { | 392 if (m_pressedPart == ThumbPart) { |
393 if (theme()->shouldSnapBackToDragOrigin(this, evt)) { | 393 if (theme()->shouldSnapBackToDragOrigin(this, evt)) { |
394 if (m_scrollableArea) | 394 if (m_scrollableArea) |
395 m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation,
m_dragOrigin); | 395 m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation,
m_dragOrigin + m_scrollableArea->minimumScrollPosition(m_orientation)); |
396 } else { | 396 } else { |
397 moveThumb(m_orientation == HorizontalScrollbar ? | 397 moveThumb(m_orientation == HorizontalScrollbar ? |
398 convertFromContainingWindow(evt.position()).x() : | 398 convertFromContainingWindow(evt.position()).x() : |
399 convertFromContainingWindow(evt.position()).y(), theme()->
shouldDragDocumentInsteadOfThumb(this, evt)); | 399 convertFromContainingWindow(evt.position()).y(), theme()->
shouldDragDocumentInsteadOfThumb(this, evt)); |
400 } | 400 } |
401 return; | 401 return; |
402 } | 402 } |
403 | 403 |
404 if (m_pressedPart != NoPart) | 404 if (m_pressedPart != NoPart) |
405 m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContain
ingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y(); | 405 m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContain
ingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y(); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 if (!m_scrollableArea) | 597 if (!m_scrollableArea) |
598 return 0; | 598 return 0; |
599 | 599 |
600 if (m_orientation == HorizontalScrollbar) | 600 if (m_orientation == HorizontalScrollbar) |
601 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); | 601 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); |
602 | 602 |
603 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); | 603 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); |
604 } | 604 } |
605 | 605 |
606 } // namespace WebCore | 606 } // namespace WebCore |
OLD | NEW |