avoid convertTouchToNodeSpace because of mac

This commit is contained in:
mat 2023-10-22 10:53:40 -03:00 committed by GitHub
parent 2d8e988ce3
commit d6de1187d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,10 +10,9 @@ using namespace geode::prelude;
struct CCTextInputNodeFix : Modify<CCTextInputNodeFix, CCTextInputNode> {
bool ccTouchBegan(CCTouch* touch, CCEvent* event) {
CCPoint pos = this->convertTouchToNodeSpace(touch);
CCSize size = this->getContentSize();
pos += m_textField->getAnchorPoint() * size;
auto const touchPos = touch->getLocation();
auto const size = this->getContentSize();
auto const pos = this->convertToNodeSpace(touchPos) + m_textField->getAnchorPoint() * size;
if (pos.x < 0 || pos.x > size.width || pos.y < 0 || pos.y > size.height)
return false;