Code-style consistency improvement:

Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
erwincoumans
2018-09-23 14:17:31 -07:00
parent b73b05e9fb
commit ab8f16961e
1773 changed files with 1081087 additions and 474249 deletions

View File

@@ -4,29 +4,26 @@
See license in Gwen.h
*/
#include "Gwen/Controls/Dragger.h"
using namespace Gwen;
using namespace Gwen::ControlsInternal;
GWEN_CONTROL_CONSTRUCTOR( Dragger )
GWEN_CONTROL_CONSTRUCTOR(Dragger)
{
m_pTarget = NULL;
SetMouseInputEnabled( true );
SetMouseInputEnabled(true);
m_bDepressed = false;
}
void Dragger::OnMouseClickLeft( int x, int y, bool bDown )
void Dragger::OnMouseClickLeft(int x, int y, bool bDown)
{
if ( !m_pTarget ) return;
if (!m_pTarget) return;
if ( bDown )
if (bDown)
{
m_bDepressed = true;
m_HoldPos = m_pTarget->CanvasPosToLocal( Gwen::Point( x, y ) );
m_HoldPos = m_pTarget->CanvasPosToLocal(Gwen::Point(x, y));
Gwen::MouseFocus = this;
}
else
@@ -37,23 +34,23 @@ void Dragger::OnMouseClickLeft( int x, int y, bool bDown )
}
}
void Dragger::OnMouseMoved( int x, int y, int /*deltaX*/, int /*deltaY*/ )
void Dragger::OnMouseMoved(int x, int y, int /*deltaX*/, int /*deltaY*/)
{
if ( !m_pTarget ) return;
if ( !m_bDepressed ) return;
if (!m_pTarget) return;
if (!m_bDepressed) return;
Gwen::Point p = Gwen::Point(x - m_HoldPos.x, y - m_HoldPos.y);
Gwen::Point p = Gwen::Point( x - m_HoldPos.x, y - m_HoldPos.y );
// Translate to parent
if ( m_pTarget->GetParent() )
p = m_pTarget->GetParent()->CanvasPosToLocal( p );
if (m_pTarget->GetParent())
p = m_pTarget->GetParent()->CanvasPosToLocal(p);
//m_pTarget->SetPosition( p.x, p.y );
m_pTarget->MoveTo( p.x, p.y );
onDragged.Call( this );
m_pTarget->MoveTo(p.x, p.y);
onDragged.Call(this);
}
void Dragger::Render( Skin::Base* /*skin*/ )
void Dragger::Render(Skin::Base* /*skin*/)
{
//skin->DrawButton(this,false,false);
}