Skip to content

Commit

Permalink
Checking, does the touch is within the height of the line, not the he…
Browse files Browse the repository at this point in the history
…ight of the sprite? (cocos2d#19394)
  • Loading branch information
kasandko authored and minggo committed Apr 10, 2019
1 parent 86a9e0c commit 660d923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cocos/2d/CCTextFieldTTF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void TextFieldTTF::setCursorFromPoint(const Vec2 &point, const Camera* camera)
auto sprite = getLetter(latterPosition);
if (sprite)
{
rect.size = sprite->getContentSize();
rect.size = Size(sprite->getContentSize().width, _lineHeight);
if (isScreenPointInRect(point, camera, sprite->getWorldToNodeTransform(), rect, nullptr))
{
setCursorPosition(latterPosition);
Expand Down

0 comments on commit 660d923

Please sign in to comment.