- if (m_attachmentMode)
- {
- double top = (double)(m_ypos + m_height/2.0);
- double bottom = (double)(m_ypos - m_height/2.0);
- double left = (double)(m_xpos - m_width/2.0);
- double right = (double)(m_xpos + m_width/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;
- }
- else
- { *x = m_xpos; *y = m_ypos; return TRUE; }
+ return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line);