Skip to content

Commit 378e3cd

Browse files
kasandkominggo
authored andcommitted
Checking, does the touch is within the height of the line, not the height of the sprite? (#19394)
1 parent 9011e84 commit 378e3cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos/2d/CCTextFieldTTF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ void TextFieldTTF::setCursorFromPoint(const Vec2 &point, const Camera* camera)
387387
auto sprite = getLetter(latterPosition);
388388
if (sprite)
389389
{
390-
rect.size = sprite->getContentSize();
390+
rect.size = Size(sprite->getContentSize().width, _lineHeight);
391391
if (isScreenPointInRect(point, camera, sprite->getWorldToNodeTransform(), rect, nullptr))
392392
{
393393
setCursorPosition(latterPosition);

0 commit comments

Comments
 (0)