+ else
+ {
+ if (m_attachmentPoints.Number() > 0)
+ {
+ wxNode *node = m_attachmentPoints.First();
+ while (node)
+ {
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ if (point->m_id == attachment)
+ {
+ *x = (double)(m_xpos + point->m_x);
+ *y = (double)(m_ypos + point->m_y);
+ return TRUE;
+ }
+ node = node->Next();
+ }
+ *x = m_xpos; *y = m_ypos;
+ return FALSE;
+ }
+ else
+ {
+ // Assume is rectangular
+ double w, h;
+ GetBoundingBoxMax(&w, &h);
+ double top = (double)(m_ypos + h/2.0);
+ double bottom = (double)(m_ypos - h/2.0);
+ double left = (double)(m_xpos - w/2.0);
+ double right = (double)(m_xpos + w/2.0);
+
+ bool isEnd = (line && line->IsEnd(this));
+
+ // Simplified code
+ switch (attachment)
+ {
+ case 0:
+ {
+ wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(left, bottom), wxRealPoint(right, bottom),
+ nth, no_arcs, line);
+
+ *x = pt.x; *y = pt.y;
+ break;
+ }
+ case 1:
+ {
+ wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(right, bottom), wxRealPoint(right, top),
+ nth, no_arcs, line);
+
+ *x = pt.x; *y = pt.y;
+ break;
+ }
+ case 2:
+ {
+ wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(left, top), wxRealPoint(right, top),
+ nth, no_arcs, line);
+
+ *x = pt.x; *y = pt.y;
+ break;
+ }
+ case 3:
+ {
+ wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(left, bottom), wxRealPoint(left, top),
+ nth, no_arcs, line);
+
+ *x = pt.x; *y = pt.y;
+ break;
+ }
+ default:
+ {
+ return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line);
+ break;
+ }
+ }
+ return TRUE;
+ }
+ }