[vlc-commits] [Git][videolan/vlc][master] qml: use proper reference point for sub-texturing wrt visual rect in `DualKawaseBlur`
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun May 31 14:23:53 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
4e56697c by Fatih Uzunoglu at 2026-05-31T16:12:10+02:00
qml: use proper reference point for sub-texturing wrt visual rect in `DualKawaseBlur`
Since without `visualRect` the visual (and texture) is centered, when
`visualRect` is set, we should take the reference point for sub-texturing
from the center of the visual.
- - - - -
1 changed file:
- modules/gui/qt/widgets/qml/DualKawaseBlur.qml
Changes:
=====================================
modules/gui/qt/widgets/qml/DualKawaseBlur.qml
=====================================
@@ -141,7 +141,10 @@ Item {
// rect is set to discard the empty margins. Another use case is freely
// adjusting the position of the visual when viewport rect is smaller than
// the effect size, since with only viewport rect the visual is always
- // centered in the parent (effect).
+ // centered in the parent (effect). Note that the reference point used
+ // for sub-texturing is (visualRect.xy - viewportRect.xy), which makes the
+ // texture centered with `viewportRect.xy` acting as the margins, and
+ // the value can be both positive or negative.
// NOTE: `visualRect` is expected to be in item coordinates, similar to
// `sourceRect`.
property rect visualRect
@@ -536,7 +539,8 @@ Item {
// NOTE: Vertex shader is set in `DefaultShaderEffect` when `normalRect` is valid.
- normalRect: useSubTexture ? Qt.rect(0, 0,
+ normalRect: useSubTexture ? Qt.rect((root._localVisualRect.x - root._localViewportRect.x) * root.eDPR / sourceTextureSize.width,
+ (root._localVisualRect.y - root._localViewportRect.y) * root.eDPR / sourceTextureSize.height,
root._localVisualRect.width * root.eDPR / sourceTextureSize.width,
root._localVisualRect.height * root.eDPR / sourceTextureSize.height)
: Qt.rect(0,0,0,0)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4e56697c59845de54c695e224d78b0f285158497
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4e56697c59845de54c695e224d78b0f285158497
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list