Fix: VSE strip thumbnails sometimes go 1px outside of boundary #123119

Merged
Aras Pranckevicius merged 1 commits from aras_p/blender:vse-thumb-crop-fix into blender-v4.2-release 2024-06-12 12:43:13 +02:00

The VSE timeline strip thumbnail code seems to have at least two issues:

Sometimes the thumbnail would go 1px outside of the right side of the strip itself. This seems to be caused by floating point inaccuracy where current thumbnail position is tracked in "fractional timeline frames" instead of some integers like pixels. The last, often clipped, thumbnail would thus spill over outside of the strip. Fixed this by making sure the last pixel column of the strip is not included into thumbnail drawing (pointless to draw there since it is always covered by strip border).

Another problem was that the first thumbnail of the strip was often incorrectly clipped and the last pixel from it was removed, and so it was leaving a pixel gap between first and other thumbnails. This was under "Set the clipping bound to show the left handle moving"
comment, where due to inclusive range check it was always causing the "clipped" part to be set to true for the first thumb.

Also while trying to untangle all of this, moved variables closer to their usage. Some of them were only used inside the thumb loop but were declared in whole function (probably coming from when it was C code).

Before the fix:
thumbfix-annot.png

With this PR:
thumbfix-1.png

The VSE timeline strip thumbnail code seems to have at least two issues: Sometimes the thumbnail would go 1px outside of the right side of the strip itself. This seems to be caused by floating point inaccuracy where current thumbnail position is tracked in "fractional timeline frames" instead of some integers like pixels. The last, often clipped, thumbnail would thus spill over outside of the strip. Fixed this by making sure the last pixel column of the strip is not included into thumbnail drawing (pointless to draw there since it is always covered by strip border). Another problem was that the first thumbnail of the strip was often incorrectly clipped and the last pixel from it was removed, and so it was leaving a pixel gap between first and other thumbnails. This was under "Set the clipping bound to show the left handle moving" comment, where due to inclusive range check it was always causing the "clipped" part to be set to true for the first thumb. Also while trying to untangle all of this, moved variables closer to their usage. Some of them were only used inside the thumb loop but were declared in whole function (probably coming from when it was C code). Before the fix: ![thumbfix-annot.png](/attachments/aaf98762-c26e-423c-b93d-adbb42fa245d) With this PR: ![thumbfix-1.png](/attachments/10a0eb76-2112-4bf0-9a64-4ea0d8e00819)
Aras Pranckevicius added 1 commit 2024-06-12 10:59:25 +02:00
Fix: VSE strip thumbnails sometimes go 1px outside of boundary
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
fac39b3a01
The VSE timeline strip thumbnail code seems to have at least two issues:

Sometimes the thumbnail would go 1px outside of the right side
of the strip itself. This seems to be caused by floating point
inaccuracy where current thumbnail position is tracked in "fractional
timeline frames" instead of some integers like pixels. The last, often
clipped, thumbnail would thus spill over outside of the strip.
Fixed this by making sure the last pixel column of the strip is not
included into thumbnail drawing (pointless to draw there since
it is always covered by strip border).

Another problem was that the first thumbnail of the strip was often
incorrectly clipped and the last pixel from it was removed, and so
it was leaving a pixel gap between first and other thumbnails.
This was under "Set the clipping bound to show the left handle moving"
comment, where due to inclusive range check it was always causing
the "clipped" part to be set to true for the first thumb.

Also while trying to untangle all of this, moved variables closer
to their usage. Some of them were only used inside the thumb loop
but were declared in whole function (probably coming from when it was
C code).
Author
Member

@blender-bot build

@blender-bot build
Aras Pranckevicius requested review from Sergey Sharybin 2024-06-12 11:01:51 +02:00
Author
Member

Buildbot failures are the same as what is happening on 4.2 branch right now (script_load_addons and script_load_modules tests fail with python syntax error, wheee)

Buildbot failures are the same as what is happening on 4.2 branch right now (`script_load_addons` and `script_load_modules` tests fail with python syntax error, wheee)
Sergey Sharybin approved these changes 2024-06-12 12:04:38 +02:00
Aras Pranckevicius merged commit b7cd88d502 into blender-v4.2-release 2024-06-12 12:43:13 +02:00
Aras Pranckevicius deleted branch vse-thumb-crop-fix 2024-06-12 12:43:16 +02:00
First-time contributor

Could be the reason for this too: #118719

Could be the reason for this too: https://projects.blender.org/blender/blender/issues/118719
Author
Member

Could be the reason for this too: #118719

Very unlikely. But on that issue, no one else could reproduce it, and you never attached files that would reproduce it either, so 🤷

> Could be the reason for this too: https://projects.blender.org/blender/blender/issues/118719 Very unlikely. But on that issue, no one else could reproduce it, and you never attached files that would reproduce it either, so 🤷
First-time contributor

It was very hit-and-miss. Sometimes it happened, and sometimes it did not. Sometimes it disappeared after a while. So, a file wouldn't have made any difference.

It was very hit-and-miss. Sometimes it happened, and sometimes it did not. Sometimes it disappeared after a while. So, a file wouldn't have made any difference.
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#123119
No description provided.