From 0ffe183d71fddf01ab9b29d9cf159654ebc8b492 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 15 Mar 2019 15:24:52 +0100 Subject: [PATCH] FrameSvgItem: fix textureRect for tiled subitems to not shrink to 0 Summary: The old logic results in broken rendering if the sample was bigger than the area to render, due to normalized texture rect being 0 in the respective dimansion. As well as stretched mapping of the sample for fractional relationships between the area to render and the sample size. Test Plan: Borders of backgrounds of FluffyBunny theme render properly, no other regressions seen (but unsure what else might rely on that artifact). Reviewers: #plasma, mart Reviewed By: #plasma, mart Subscribers: apol, sitter, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D19787 --- src/declarativeimports/core/framesvgitem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarativeimports/core/framesvgitem.cpp b/src/declarativeimports/core/framesvgitem.cpp index 989fce867..539105f28 100644 --- a/src/declarativeimports/core/framesvgitem.cpp +++ b/src/declarativeimports/core/framesvgitem.cpp @@ -145,11 +145,13 @@ public: //if tiling horizontally if (m_border == FrameSvg::TopBorder || m_border == FrameSvg::BottomBorder || m_border == FrameSvg::NoBorder) { - textureRect.setWidth(nodeRect.width() / m_elementNativeSize.width()); + // cmp. CSS3's border-image-repeat: "repeat", though with first tile not centered, but aligned to left + textureRect.setWidth((qreal) nodeRect.width() / m_elementNativeSize.width()); } //if tiling vertically if (m_border == FrameSvg::LeftBorder || m_border == FrameSvg::RightBorder || m_border == FrameSvg::NoBorder) { - textureRect.setHeight(nodeRect.height() / m_elementNativeSize.height()); + // cmp. CSS3's border-image-repeat: "repeat", though with first tile not centered, but aligned to top + textureRect.setHeight((qreal) nodeRect.height() / m_elementNativeSize.height()); } } else if (m_fitMode == Stretch) { QString prefix = m_frameSvg->frameSvg()->actualPrefix();