Skip to content

Scale from Cursor in AnimationPlayer does not scale from cursor #105714

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

Open
Arnklit opened this issue Apr 24, 2025 · 0 comments · May be fixed by #105715
Open

Scale from Cursor in AnimationPlayer does not scale from cursor #105714

Arnklit opened this issue Apr 24, 2025 · 0 comments · May be fixed by #105715

Comments

@Arnklit
Copy link
Contributor

Arnklit commented Apr 24, 2025

Tested versions

Reproducible in:
Master
4.4.1.stable
3.6.stable

System information

Godot v4.4.1.stable - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Laptop GPU (NVIDIA; 32.0.15.6614) - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 threads)

Issue description

Scale from Cursor option does the same as Scale Selection. It uses the first key as pivot.

Godot_v4.4.1-stable_win64_LO6lnHDjh7.mp4

This is because last_menu_track_opt is set to EDIT_SCALE_CONFIRM by the time it's checked:

if (last_menu_track_opt == EDIT_SCALE_FROM_CURSOR) {

The actual function for scaling is also incorrect, while the pivot is not set correctly because of the above, it is also not used correctly in the function:

current:

#define NEW_POS(m_ofs) (((s > 0) ? m_ofs : from_t + (len - (m_ofs - from_t))) - pivot) * Math::abs(s) + from_t

suggested:

#define NEW_POS(m_ofs) (((s > 0) ? m_ofs : from_t + (len - (m_ofs - from_t))) - pivot) * Math::abs(s) + pivot

Steps to reproduce

Select some keys and use the function.

Minimal reproduction project (MRP)

NA

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

Successfully merging a pull request may close this issue.

2 participants