mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
New: CPEvent scrollingDeltaX, scrollingDeltaY and hasPreciseScrollingDeltas.
Refs #2013.
This commit is contained in:
@@ -68,6 +68,9 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
float _deltaX;
|
||||
float _deltaY;
|
||||
float _deltaZ;
|
||||
float _scrollingDeltaX;
|
||||
float _scrollingDeltaY;
|
||||
BOOL _hasPreciseScrollingDeltas;
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
BOOL _suppressCappuccinoCut;
|
||||
@@ -163,7 +166,9 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
|
||||
// Make sure these are 0 rather than nil.
|
||||
_deltaX = 0;
|
||||
_scrollingDeltaX = 0;
|
||||
_deltaY = 0;
|
||||
_scrollingDeltaY = 0;
|
||||
_deltaZ = 0;
|
||||
}
|
||||
|
||||
@@ -417,6 +422,31 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
return _deltaZ;
|
||||
}
|
||||
|
||||
- (BOOL)hasPreciseScrollingDeltas
|
||||
{
|
||||
return !!_hasPreciseScrollingDeltas;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the change in points on the x-axis for a mouse movement, unless hasPreciseScrollingDeltas is NO,
|
||||
in which case the change is measured in number of "lines" or "rows" and needs to be multiplied as appropriate
|
||||
to get change in pixels.
|
||||
*/
|
||||
- (float)scrollingDeltaX
|
||||
{
|
||||
return _scrollingDeltaX;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the change in points on the y-axis for a mouse movement, unless hasPreciseScrollingDeltas is NO,
|
||||
in which case the change is measured in number of "lines" or "columns" and needs to be multiplied as appropriate
|
||||
to get change in pixels.
|
||||
*/
|
||||
- (float)scrollingDeltaY
|
||||
{
|
||||
return _scrollingDeltaY;
|
||||
}
|
||||
|
||||
- (BOOL)_triggersKeyEquivalent:(CPString)aKeyEquivalent withModifierMask:aKeyEquivalentModifierMask
|
||||
{
|
||||
if (!aKeyEquivalent)
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
[self assert:0 equals:[anEvent deltaX] message:"default event delta X should be 0"];
|
||||
[self assert:0 equals:[anEvent deltaY] message:"default event delta Y should be 0"];
|
||||
[self assert:0 equals:[anEvent deltaZ] message:"default event delta Z should be 0"];
|
||||
[self assert:0 equals:[anEvent scrollingDeltaX] message:"default event scrolling delta X should be 0"];
|
||||
[self assert:0 equals:[anEvent scrollingDeltaY] message:"default event scrolling delta Y should be 0"];
|
||||
}
|
||||
|
||||
- (void)testDescription
|
||||
|
||||
Reference in New Issue
Block a user