* Source/NSEvent.m (-deltaX, -deltaY, -deltaZ): Don't raise an

exception when called on the wrong type of event.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31766 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-12-23 16:48:12 +00:00
parent 4abc4ac83b
commit 3817cc34d5
2 changed files with 14 additions and 15 deletions

View file

@ -1,3 +1,8 @@
2010-12-23 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSEvent.m (-deltaX, -deltaY, -deltaZ): Don't raise an
exception when called on the wrong type of event.
2010-12-22 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSView.h,

View file

@ -517,16 +517,14 @@ static Class eventClass;
</p>
<p>
This method is only valid for NSMouseMoved, NS*MouseDragged and
NSScrollWheel events, otherwise it will raise an
NSInternalInconsistencyException.
NSScrollWheel events, otherwise it will return 0.
</p>
*/
- (float)deltaX
- (float) deltaX
{
if (!(NSEventMaskFromType(event_type) & GSMouseMovedEventMask))
{
[NSException raise: NSInternalInconsistencyException
format: @"deltaX requested for invalid event type"];
return 0.0;
}
return event_data.mouse.deltaX;
}
@ -537,16 +535,14 @@ static Class eventClass;
</p>
<p>
This method is only valid for NSMouseMoved, NS*MouseDragged and
NSScrollWheel events, otherwise it will raise an
NSInternalInconsistencyException.
NSScrollWheel events, otherwise it will return 0.
</p>
*/
- (float)deltaY
- (float) deltaY
{
if (!(NSEventMaskFromType(event_type) & GSMouseMovedEventMask))
{
[NSException raise: NSInternalInconsistencyException
format: @"deltaY requested for invalid event type"];
return 0.0;
}
return event_data.mouse.deltaY;
}
@ -557,19 +553,17 @@ static Class eventClass;
</p>
<p>
This method is only valid for NSMouseMoved, NS*MouseDragged and
NSScrollWheel events, otherwise it will raise an
NSInternalInconsistencyException.
NSScrollWheel events, otherwise it will return 0.
</p>
<p>
The value returned is 0.0 in most cases.
</p>
*/
- (float)deltaZ
- (float) deltaZ
{
if (!(NSEventMaskFromType(event_type) & GSMouseMovedEventMask))
{
[NSException raise: NSInternalInconsistencyException
format: @"deltaZ requested for invalid event type"];
return 0.0;
}
return event_data.mouse.deltaZ;
}