~sil2100/nux/revert_640

« back to all changes in this revision

Viewing changes to Nux/Area.cpp

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-08-08 12:58:24 UTC
  • Revision ID: lukasz.zemczak@canonical.com-20120808125824-12o0md3gbv5jrawm
Reverting revision 640, as it was causing many serious regressions. The direct cause seems to be libgeis, not the nux changes themselves - but this is the easiest way of resolving the problem. This code can be re-added once geis is fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "BaseWindow.h"
30
30
#include "MenuPage.h"
31
31
 
32
 
#ifdef NUX_GESTURES_SUPPORT
33
 
#include "NuxGraphics/GestureEvent.h"
34
 
#endif
35
 
 
36
32
namespace nux
37
33
{
38
34
 
1040
1036
 
1041
1037
    return false;
1042
1038
  }
1043
 
 
1044
 
#ifdef NUX_GESTURES_SUPPORT
1045
 
  Area* Area::GetInputAreaHitByGesture(const GestureEvent &event)
1046
 
  {
1047
 
    return nullptr;
1048
 
  }
1049
 
 
1050
 
  bool Area::IsGestureInsideArea(const nux::GestureEvent &event) const
1051
 
  {
1052
 
    if (event.IsDirectTouch())
1053
 
    {
1054
 
      Geometry geometry = GetAbsoluteGeometry();
1055
 
      Point p;
1056
 
      for (const auto touch_point : event.GetTouches())
1057
 
      {
1058
 
        p.x = (int)touch_point.x;
1059
 
        p.y = (int)touch_point.y;
1060
 
        if (!geometry.IsInside(p))
1061
 
          return false;
1062
 
      }
1063
 
      return true;
1064
 
    }
1065
 
    else
1066
 
    {
1067
 
      return GetAbsoluteGeometry().IsInside(event.GetFocus());
1068
 
    }
1069
 
  }
1070
 
 
1071
 
#endif // NUX_GESTURES_SUPPORT
1072
1039
}
1073
1040