Fix texture generation

master
Jeremy Hu 2019-09-22 13:25:43 +09:30
parent a5bfe83cea
commit c79ba9ee7c
1 changed files with 5 additions and 4 deletions

View File

@ -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);
}