Remove titleblocktemplate cahing remains.

This commit is contained in:
Andre Rummler
2026-09-17 00:06:22 +02:00
parent 837e1e7f09
commit 1ee828da5b
3 changed files with 1 additions and 39 deletions
+1 -31
View File
@@ -8,8 +8,7 @@
*/
TitleBlockTemplateRenderer::TitleBlockTemplateRenderer(QObject *parent) :
QObject(parent),
m_titleblock_template(nullptr),
m_last_known_titleblock_width(-1)
m_titleblock_template(nullptr)
{
}
@@ -38,7 +37,6 @@ void TitleBlockTemplateRenderer::setTitleBlockTemplate(
const TitleBlockTemplate *titleblock_template) {
if (titleblock_template != m_titleblock_template) {
m_titleblock_template = titleblock_template;
invalidateRenderedTemplate();
}
}
@@ -48,7 +46,6 @@ void TitleBlockTemplateRenderer::setTitleBlockTemplate(
*/
void TitleBlockTemplateRenderer::setContext(const DiagramContext &context) {
m_context = context;
invalidateRenderedTemplate();
}
/**
@@ -106,30 +103,3 @@ void TitleBlockTemplateRenderer::renderDxf(QRectF &title_block_rect,
file_path, color);
}
/**
@brief TitleBlockTemplateRenderer::renderToQPicture
Renders the titleblock to the internal QPicture
@param titleblock_width : Width of the titleblock to render
*/
void TitleBlockTemplateRenderer::renderToQPicture(int titleblock_width) {
if (!m_titleblock_template) return;
// we render the template on our internal QPicture
QPainter painter(&m_rendered_template);
m_titleblock_template -> render(painter, m_context, titleblock_width);
// memorize the last known width
m_last_known_titleblock_width = titleblock_width;
}
/**
@brief TitleBlockTemplateRenderer::invalidateRenderedTemplate
Invalidates the previous rendering of the template
by resetting the internal QPicture.
*/
void TitleBlockTemplateRenderer::invalidateRenderedTemplate()
{
m_rendered_template = QPicture();
}