Cuperino / QPrompt-Teleprompter

Teleprompter software for all video creators. Built with ease of use, productivity, control accuracy, and smooth performance in mind.
https://qprompt.app
GNU General Public License v3.0
354 stars 22 forks source link

Cursor location changes with Normal/Small font selection #223

Open videosmith opened 8 months ago

videosmith commented 8 months ago

Bug Description When changing from Normal to Small fonts or back, the current cursor location changes.

Steps to Reproduce

  1. Load your Welcome script
  2. Place the cursor next to a word
  3. Switch to Small fonts, cursor moves to new location

Expected behavior Cursor location should remain next to the same text.

Screenshots (optional) Screenshot from 2023-10-15 13-04-22 Screenshot from 2023-10-15 13-09-06 Screenshot from 2023-10-15 13-10-10

Device information

Cuperino commented 8 months ago

Positions are adjusted based on where the reading region is pointing to, prior to considering the actual position of the cursor.

If only the cursor position were used, and you went through a long script making changes, and then back to the start to start prompting, the moment the Normal font size was restored, the viewport's position would jump all the way back to near the bottom of the script to where the text cursor remained placed, and the user would have to scroll a long distance to where they were a moment ago.

The solution I came up with is that when sizes are toggled, the cursor position is set to the beginning of the line the reading region points to. Nevertheless, this repositioning intentionally doesn't happen when going from small to normal when the position of the text cursor is within the line the reading region is pointing to, which allows us to return to our previous line in the case of the button for toggling between font sizes being toggled multiple times one after the other.

In other words, this was a small compromise and a design choice made to prevent QPrompt from becoming frustrating to users. Having said that, there might be room for improvement here. It might be possible to compare against the area visible inside the viewport and not just the position of the reading region, then only use the reading region if the cursor is outside of the visible area...

I'll leave this open for now, to do experiments later.

Cuperino commented 3 months ago

Details copied from #245:

Bug Description When cycling between normal and small font sizes, unless beginning of paragraph coincides with the middle of the prompt window, cursor position moves. Also appears to occur when paragraph spacing is >000%

Steps to Reproduce

  1. Load attached long test file
  2. Pick a paragraph, center the beginning in the middle of a full-screen QPrompt window, and place the cursor at the beginning.
  3. Cycle between the normal and AA font sizes, cursor should remain where it was placed.
  4. In the normal size, slightly scroll the script so the selected paragraph is either lower or higher than the center.
  5. Repeat the cycling. Cursor should reposition at another place in the script.
  6. Place cursor at the beginning of a paragraph, adjust paragraph spacing, cursor moves.

Expected behavior Cursor should always position where is was placed regardless of script position

screen

test.html.zip

Device information