From ba270e07f263bd78ac1b14b09631c92393d31154 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 18 Apr 2012 09:38:17 +0100 Subject: [PATCH] store Transformer by value in conv_transform --- deps/agg/include/agg_conv_transform.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/deps/agg/include/agg_conv_transform.h b/deps/agg/include/agg_conv_transform.h index 171087748..84eb736cc 100644 --- a/deps/agg/include/agg_conv_transform.h +++ b/deps/agg/include/agg_conv_transform.h @@ -29,10 +29,14 @@ namespace agg template class conv_transform { public: + explicit conv_transform(VertexSource& source) : + m_source(&source), m_trans() {} + conv_transform(VertexSource& source, const Transformer& tr) : - m_source(&source), m_trans(&tr) {} + m_source(&source), m_trans(tr) {} + void attach(VertexSource& source) { m_source = &source; } - + void rewind(unsigned path_id) { m_source->rewind(path_id); @@ -43,14 +47,14 @@ namespace agg unsigned cmd = m_source->vertex(x, y); if(is_vertex(cmd)) { - m_trans->transform(x, y); + m_trans.transform(x, y); } return cmd; } void transformer(const Transformer& tr) { - m_trans = &tr; + m_trans = tr; } private: @@ -59,7 +63,7 @@ namespace agg operator = (const conv_transform&); VertexSource* m_source; - const Transformer* m_trans; + Transformer m_trans; };