[vlc-commits] [Git][videolan/vlc][master] qt: extrapolate rounded rectangle path in QSGRoundedRectangularImageNode

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Mar 9 17:50:04 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
c774fdba by Fatih Uzunoglu at 2024-03-09T15:42:28+00:00
qt: extrapolate rounded rectangle path in QSGRoundedRectangularImageNode

This should correct some artifacts seen with small
nodes which caused by having too few vertices
to represent a rounded rectangle.

- - - - -


1 changed file:

- modules/gui/qt/util/qsgroundedrectangularimagenode.cpp


Changes:

=====================================
modules/gui/qt/util/qsgroundedrectangularimagenode.cpp
=====================================
@@ -183,7 +183,12 @@ QSGGeometry* QSGRoundedRectangularImageNode::rebuildGeometry(const Shape& shape,
         else
         {
             QPainterPath painterPath;
-            painterPath.addRoundedRect(0, 0, key.first.first, key.first.second, key.second, key.second);
+            constexpr const short extrapolationFactor = 2;
+            painterPath.addRoundedRect(0, 0,
+                                       key.first.first * extrapolationFactor,
+                                       key.first.second * extrapolationFactor,
+                                       key.second * extrapolationFactor,
+                                       key.second * extrapolationFactor);
             painterPath = painterPath.simplified();
 
             upPath = std::make_unique<QVector<QPointF>>(painterPath.elementCount());
@@ -201,7 +206,7 @@ QSGGeometry* QSGRoundedRectangularImageNode::rebuildGeometry(const Shape& shape,
 
                 // Symmetry based triangulation based on ordered painter path.
                 (*path)[i] = (painterPath.elementAt((i % 2) ? (i)
-                                                            : (elementCount - i - 1)));
+                                                            : (elementCount - i - 1))) / extrapolationFactor;
             }
 
             paths.insert(key, new QVector<QPointF>(*path));



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c774fdbae915f736b5ed535219223c98eb6f5434

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c774fdbae915f736b5ed535219223c98eb6f5434
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