[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: take care of `originY` in `Helpers::positionFlickableToContainItem()`

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Thu Nov 13 18:59:42 UTC 2025



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
3ed66b0b by Fatih Uzunoglu at 2025-11-13T20:33:55+02:00
qml: take care of `originY` in `Helpers::positionFlickableToContainItem()`

Otherwise bounds are not correctly calculated for certain cases, such as
having a header with overlay positioning. Currently this bug does not
seem to be exposed, though.

- - - - -
b60e90c7 by Fatih Uzunoglu at 2025-11-13T20:33:55+02:00
qml: fix bounds in `Helpers::flickablePositionContaining()`

- - - - -


1 changed file:

- modules/gui/qt/util/qml/Helpers.qml


Changes:

=====================================
modules/gui/qt/util/qml/Helpers.qml
=====================================
@@ -121,7 +121,9 @@ QtObject {
         else
             newContentY = flickable.contentY
 
-        return clamp(newContentY, flickable.originY, flickable.originY + flickable.contentHeight)
+        return clamp(newContentY,
+                     flickable.originY - flickable.topMargin,
+                     flickable.originY + flickable.contentHeight - flickable.height + flickable.bottomMargin)
     }
 
     function isArray(obj) {
@@ -150,8 +152,8 @@ QtObject {
         const mappedRect = flickable.mapFromItem(item.parent, Qt.rect(item.x, item.y, item.width, item.height))
         // Flickable does not fully contain the item:
         if ((mappedRect.y < 0) || ((mappedRect.y + mappedRect.height) > flickable.height))
-            flickable.contentY = Math.min(Math.max(-flickable.topMargin,
+            flickable.contentY = Math.min(Math.max(flickable.originY - flickable.topMargin,
                                                    flickable.contentItem.mapFromItem(item.parent, item.x, item.y).y - Math.max(0, ((flickable.height - item.height) / 2))),
-                                          flickable.contentHeight - flickable.height + flickable.bottomMargin)
+                                          flickable.originY + flickable.contentHeight - flickable.height + flickable.bottomMargin)
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8905cb28a04647f7ea03433944040aac0eb29ebb...b60e90c799f1f944dc8ab0a542abf6f99283bcfb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8905cb28a04647f7ea03433944040aac0eb29ebb...b60e90c799f1f944dc8ab0a542abf6f99283bcfb
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list