0006-Improve-fix-for-avoiding-huge-number-of-tiny-dashes.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 856d11f695fb6effe26a359f9ad0efdf24067085 Mon Sep 17 00:00:00 2001
  2. From: Eirik Aavitsland <eirik.aavitsland@qt.io>
  3. Date: Fri, 23 Jul 2021 15:53:56 +0200
  4. Subject: [PATCH] Improve fix for avoiding huge number of tiny dashes
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Some pathological cases were not caught by the previous fix.
  9. Fixes: QTBUG-95239
  10. Pick-to: 6.2 6.1 5.15
  11. Change-Id: I0337ee3923ff93ccb36c4d7b810a9c0667354cc5
  12. Reviewed-by: Robert Löhning <robert.loehning@qt.io>
  13. (cherry picked from commit 6b400e3147dcfd8cc3a393ace1bd118c93762e0c)
  14. [Retrieved from: https://invent.kde.org/qt/qt/qtbase/-/commit/fed5713eeba5bf8e0ee413cb4e77109bfa7c2bce]
  15. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
  16. ---
  17. src/gui/painting/qpaintengineex.cpp | 2 +-
  18. 1 file changed, 1 insertion(+), 1 deletion(-)
  19. diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
  20. index 55fdb0c2a0..19e4b23423 100644
  21. --- a/src/gui/painting/qpaintengineex.cpp
  22. +++ b/src/gui/painting/qpaintengineex.cpp
  23. @@ -426,7 +426,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &inPen)
  24. patternLength *= pen.widthF();
  25. if (qFuzzyIsNull(patternLength)) {
  26. pen.setStyle(Qt::NoPen);
  27. - } else if (extent / patternLength > 10000) {
  28. + } else if (qFuzzyIsNull(extent) || extent / patternLength > 10000) {
  29. // approximate stream of tiny dashes with semi-transparent solid line
  30. pen.setStyle(Qt::SolidLine);
  31. QColor color(pen.color());
  32. --
  33. 2.34.1