From c79ba9ee7c89f5a9ae77b07cbccb0c40b5fed769 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sun, 22 Sep 2019 13:25:43 +0930 Subject: [PATCH] Fix texture generation --- src/texturegenerator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/texturegenerator.cpp b/src/texturegenerator.cpp index 81580325..86917b0c 100644 --- a/src/texturegenerator.cpp +++ b/src/texturegenerator.cpp @@ -307,12 +307,13 @@ void TextureGenerator::generate() if (findSourceColorResult != partColorMap.end()) { const auto &color = findSourceColorResult->second; QBrush brush(color); + float fillExpandSize = 2; for (const auto &rect: rects) { QRectF translatedRect = { - rect.left() * TextureGenerator::m_textureSize, - rect.top() * TextureGenerator::m_textureSize, - rect.width() * TextureGenerator::m_textureSize, - rect.height() * TextureGenerator::m_textureSize + rect.left() * TextureGenerator::m_textureSize - fillExpandSize, + rect.top() * TextureGenerator::m_textureSize - fillExpandSize, + rect.width() * TextureGenerator::m_textureSize + fillExpandSize * 2, + rect.height() * TextureGenerator::m_textureSize + fillExpandSize * 2 }; texturePainter.fillRect(translatedRect, brush); }