diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index 84d32d3d2..0dd52bc7f 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -404,12 +404,10 @@ QString BorderTitleBlock::titleBlockTemplateName() const @brief BorderTitleBlock::titleBlockTemplateChanged This slot may be used to inform this class that the given title block template has changed. - The title block-dedicated rendering cache will thus be flushed. @param template_name : Name of the title block template that has changed */ void BorderTitleBlock::titleBlockTemplateChanged(const QString &template_name) { if (titleBlockTemplateName() != template_name) return; - m_titleblock_template_renderer -> invalidateRenderedTemplate(); } /** diff --git a/sources/titleblocktemplaterenderer.cpp b/sources/titleblocktemplaterenderer.cpp index 9ba7c5e29..d41508829 100644 --- a/sources/titleblocktemplaterenderer.cpp +++ b/sources/titleblocktemplaterenderer.cpp @@ -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(); -} - diff --git a/sources/titleblocktemplaterenderer.h b/sources/titleblocktemplaterenderer.h index 7651f00d0..b332d4cf4 100644 --- a/sources/titleblocktemplaterenderer.h +++ b/sources/titleblocktemplaterenderer.h @@ -41,15 +41,9 @@ class TitleBlockTemplateRenderer : public QObject int height() const; void render(QPainter *, int); void renderDxf(QRectF &, int, QString &, int); - void invalidateRenderedTemplate(); - - private: - void renderToQPicture(int); private: const TitleBlockTemplate *m_titleblock_template; - QPicture m_rendered_template; DiagramContext m_context; - int m_last_known_titleblock_width; }; #endif