Skip to content

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

Closed
@Arnklit

Description

@Arnklit

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions