+wxRect wxHyperlinkCtrl::GetLabelRect() const
+{
+ // our best size is always the size of the label without borders
+ wxSize c(GetClientSize()), b(GetBestSize());
+ wxPoint offset;
+
+ // the label is always centered vertically
+ offset.y = (c.GetHeight()-b.GetHeight())/2;
+
+ if (HasFlag(wxHL_ALIGN_CENTRE))
+ offset.x = (c.GetWidth()-b.GetWidth())/2;
+ else if (HasFlag(wxHL_ALIGN_RIGHT))
+ offset.x = c.GetWidth()-b.GetWidth();
+ else if (HasFlag(wxHL_ALIGN_LEFT))
+ offset.x = 0;
+ return wxRect(offset, b);
+}
+