Skip to content

Commit

Permalink
fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Metrot committed Jun 5, 2014
1 parent a6e2e7a commit 20982b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/ngl.h
Expand Up @@ -496,7 +496,7 @@ typedef wchar_t nglUChar;

# elif !defined _MINUI3_

# include <OpenGL/gl.h>
# include <GL/gl.h>
//# include <GL/glu.h>
# include "nui_GL/glext.h"
# endif
Expand Down
3 changes: 3 additions & 0 deletions src/Layout/nuiScrollView.cpp
Expand Up @@ -888,6 +888,9 @@ bool nuiScrollView::MouseMoved(const nglMouseInfo& rInfo)

void nuiScrollView::Dragged(const nglMouseInfo& rInfo)
{
if (!rInfo.Counterpart)
return;

float OldX = rInfo.Counterpart->X;
float OldY = rInfo.Counterpart->Y;
GlobalToLocal(OldX, OldY);
Expand Down
6 changes: 6 additions & 0 deletions src/WidgetTree/nuiWidget.cpp
Expand Up @@ -1859,6 +1859,7 @@ bool nuiWidget::DispatchMouseClick(const nglMouseInfo& rInfo)
bool res = PreClicked(info);
if (!res)
{
NGL_DEBUG(if (GetDebug()) NGL_LOG("widget", NGL_LOG_INFO, "%p MouseClicked (%d,%d)\n", this, rInfo.X, rInfo.Y); );
res = MouseClicked(info);
res |= Clicked(info);
}
Expand Down Expand Up @@ -1895,6 +1896,7 @@ bool nuiWidget::DispatchMouseUnclick(const nglMouseInfo& rInfo)
bool res = PreUnclicked(info);
if (!res)
{
NGL_DEBUG(if (GetDebug()) NGL_LOG("widget", NGL_LOG_INFO, "%p MouseUnclicked (%d,%d)\n", this, rInfo.X, rInfo.Y); );
res = MouseUnclicked(info);
res |= Unclicked(info);
}
Expand Down Expand Up @@ -1934,6 +1936,7 @@ bool nuiWidget::DispatchMouseCanceled(nuiWidgetPtr pThief, const nglMouseInfo& r
info.Y = Y;

PreClickCanceled(info);
NGL_DEBUG(if (GetDebug()) NGL_LOG("widget", NGL_LOG_INFO, "%p MouseCanceled (%d,%d)\n", this, rInfo.X, rInfo.Y); );
res = MouseCanceled(info);
res |= ClickCanceled(info) | (!mClickThru);
return res;
Expand Down Expand Up @@ -1967,6 +1970,7 @@ nuiWidgetPtr nuiWidget::DispatchMouseMove(const nglMouseInfo& rInfo)

if (PreMouseMoved(info))
return this;
NGL_DEBUG(if (GetDebug()) NGL_LOG("widget", NGL_LOG_INFO, "%p MouseMoved (%d,%d)\n", this, rInfo.X, rInfo.Y); );
res = MouseMoved(info);
res |= MovedMouse(info) | (!mClickThru);
return (res && inside) ? this : NULL;
Expand Down Expand Up @@ -2000,6 +2004,7 @@ nuiWidgetPtr nuiWidget::DispatchMouseWheelMove(const nglMouseInfo& rInfo)

if (PreMouseWheelMoved(info))
return this;
NGL_DEBUG(if (GetDebug()) NGL_LOG("widget", NGL_LOG_INFO, "%p MouseWheelMoved (%d,%d)\n", this, rInfo.X, rInfo.Y); );
res = MouseWheelMoved(info);
res |= WheelMovedMouse(info) | (!mClickThru);
return (res && inside) ? this : NULL;
Expand Down Expand Up @@ -2060,6 +2065,7 @@ bool nuiWidget::StealMouseEvent(const nglMouseInfo& rInfo)

bool nuiWidget::RequestStolenMouse(const nglMouseInfo& rInfo)
{
NGL_DEBUG(if (GetDebug()) NGL_LOG("widget", NGL_LOG_INFO, "%p RequestStolenMouse (%d,%d)\n", this, rInfo.X, rInfo.Y); );
return mAutoAcceptMouseSteal;
}

Expand Down

0 comments on commit 20982b9

Please sign in to comment.