Skip to content

Core: Touch event xDelta and yDelta Fixes #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
More Simplification
  • Loading branch information
scottrules44 committed Mar 2, 2023
commit 7c253c6dc2c27219205d197d625b904c07725d0f
11 changes: 3 additions & 8 deletions librtt/Rtt_Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2044,9 +2044,7 @@ TouchEvent::TouchEvent()
fYStartScreen( Rtt_REAL_0 ),
fXStartContent( Rtt_REAL_0 ),
fYStartContent( Rtt_REAL_0 ),
fPressure( kPressureInvalid ),
fDeltaX( Rtt_REAL_0 ),
fDeltaY( Rtt_REAL_0 )
fPressure( kPressureInvalid )
{
}

Expand All @@ -2058,9 +2056,7 @@ TouchEvent::TouchEvent( Real x, Real y, Real xStartScreen, Real yStartScreen, Ph
fYStartScreen( yStartScreen ),
fXStartContent( xStartScreen ),
fYStartContent( yStartScreen ),
fPressure( pressure ),
fDeltaX( x ),
fDeltaY( y )
fPressure( pressure )
{
}

Expand Down Expand Up @@ -2175,8 +2171,7 @@ MultitouchEvent::Dispatch( lua_State *L, Runtime& runtime ) const
if ( object )
{
// Dispatch focused per-object touch events
e.DispatchFocused( L, runtime, stage, object );

e.DispatchFocused( L, runtime, stage, object);
// Cleanup: remove per-object focus at the end of the touch (e.g. phase is "ended" or "cancelled")
if ( shouldCleanup )
{
Expand Down
5 changes: 1 addition & 4 deletions librtt/Rtt_Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,6 @@ class TouchEvent : public HitEvent
public:
bool IsProperty( U16 mask ) const { return (fProperties & mask) != 0; }
void SetProperty( U16 mask, bool value );
Rtt_FORCE_INLINE Real DeltaX() const { return fDeltaX; };
Rtt_FORCE_INLINE Real DeltaY() const { return fDeltaY; };

private:
U16 fPhase;
Expand All @@ -945,8 +943,7 @@ class TouchEvent : public HitEvent
mutable Real fXStartContent;
mutable Real fYStartContent;
Real fPressure;
mutable Real fDeltaX;
mutable Real fDeltaY;

};

// ----------------------------------------------------------------------------
Expand Down