audacity / audacity/audacity

Cursor misalignment when clicking in a clip

Open
#11,222 0 comments 0 reactions 0 assignees View on GitHub
bug UI
Dominant language
C++
Stars
18.4k
Forks
2.7k
Avg merge
3d 1h
Merged PRs (30d)
78

Description

### Bug description

I just notice that when i click in an audio clip to move the play cursor to that position, the play cursor ends up slightly earlier than the mouse position.

### Steps to reproduce

1. Import audio.
2. Disable snap. (I'm not using snap-to-grid.)
3. Click somewhere in the audio clip.
4. Play cursor is slightly earlier than expected.

### Expected behavior

If i align the I-beam mouse pointer with, say, 10.5 seconds, then I expect that clicking will position the play cursor exactly horizontally aligned with the mouse pointer.

### Actual behavior

The play cursor is slightly early.

### Audacity Version

Audacity 4.0 beta 2

### Operating system

Linux

### Additional context

Here, I'm zooming in on a screenshot, added a couple of vertical lines to clarify. The orange line shows where the mouse pointer is. The green line shows where the play cursor will end up.

Image

(It happens in this screenshot that the green line is very close to 0:08 seconds. However, let me restate that grid snap is definitely turned off, and, if I align the mouse pointer exactly with 0:08, the play cursor will be positioned slightly before.)

Github is identifying a potential duplicate issue (#9354) but the behavior I'm seeing has nothing to do with clip boundaries.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the offset in Audacity 4.0 beta 2 on Linux with snap disabled, using the reported click positions in an audio clip. Trace the handling of a clip click through the editor until the play cursor position is calculated. Done means the cursor is horizontally aligned with the click position, including around 10.5 or 8 seconds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.