- wxRealPoint *point = (wxRealPoint *)node->Data();
- wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
- m_points->Append((wxObject*) new_point);
- node = node->Next();
+ m_originalPoints = new wxList;
+ m_points = new wxList;
+ }
+ else
+ {
+ m_originalPoints = the_points;
+
+ // Duplicate the list of points
+ m_points = new wxList;
+
+ wxNode *node = the_points->GetFirst();
+ while (node)
+ {
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
+ wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
+ m_points->Append((wxObject*) new_point);
+ node = node->GetNext();
+ }
+ CalculateBoundingBox();
+ m_originalWidth = m_boundWidth;
+ m_originalHeight = m_boundHeight;
+ SetDefaultRegionSize();