Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gbutton的缩放动画会影响点击事件 #28

Open
huzhangyang opened this issue Dec 28, 2021 · 1 comment
Open

Gbutton的缩放动画会影响点击事件 #28

huzhangyang opened this issue Dec 28, 2021 · 1 comment

Comments

@huzhangyang
Copy link

问题:GButton的缩放动画(eg:点击时将控件大小缩放到0.8x)会影响实际点击区域,造成点击边缘时,按下时在响应区域内抬起时由于区域缩小光标在点击区域外,未触发Click事件。

解决方案:

UGButton::ConstructExtension函数中,改为设置子物体的Pivot:
for (auto child : Children) {
child->SetPivot(FVector2D(0.5f, 0.5f), IsPivotAsAnchor());
}

UGButton::SetState函数中,将SetScale函数相关操作改为缩放子物体:
for (auto child : Children) {
child->SetScale(child->GetScale() * DownEffectValue);
}

@xiaoguzhu
Copy link
Member

这个问题是存在的,一般都建议不要缩小太多,或者改成用放大。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants