Skip to content

Commit

Permalink
Fixed a pixel hit test bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguzhu committed May 22, 2018
1 parent 4e9c74e commit a7adaeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libfairygui/Classes/event/HitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PixelHitTest::PixelHitTest(PixelHitTestData * data, int offsetX, int offsetY) :
bool PixelHitTest::hitTest(GComponent * obj, const cocos2d::Vec2 & localPoint)
{
int x = floor((localPoint.x / scaleX - offsetX) * _data->scale);
int y = floor((localPoint.y / scaleY - offsetY) * _data->scale);
int y = floor(((obj->getHeight() - localPoint.y) / scaleY - offsetY) * _data->scale);
if (x < 0 || y < 0 || x >= _data->pixelWidth)
return false;

Expand Down

0 comments on commit a7adaeb

Please sign in to comment.