From f2f9466cff10eef54bd165bbfb99bbcc707a0cf4 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 3 May 2014 12:53:13 +1000 Subject: Convenience Point constructor from integers as common source of shapes. --- src/CallTip.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/CallTip.cxx') diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 7dc23a4ac..2494313bc 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -114,6 +114,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, rcClient.right = rcClient.left + widthArrow; if (draw) { const int halfWidth = widthArrow / 2 - 3; + const int quarterWidth = halfWidth / 2; const int centreX = rcClient.left + widthArrow / 2 - 1; const int centreY = (rcClient.top + rcClient.bottom) / 2; surface->FillRectangle(rcClient, colourBG); @@ -123,16 +124,16 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, if (upArrow) { // Up arrow Point pts[] = { - Point(centreX - halfWidth, centreY + halfWidth / 2), - Point(centreX + halfWidth, centreY + halfWidth / 2), - Point(centreX, centreY - halfWidth + halfWidth / 2), + Point(centreX - halfWidth, centreY + quarterWidth), + Point(centreX + halfWidth, centreY + quarterWidth), + Point(centreX, centreY - halfWidth + quarterWidth), }; surface->Polygon(pts, ELEMENTS(pts), colourBG, colourBG); } else { // Down arrow Point pts[] = { - Point(centreX - halfWidth, centreY - halfWidth / 2), - Point(centreX + halfWidth, centreY - halfWidth / 2), - Point(centreX, centreY + halfWidth - halfWidth / 2), + Point(centreX - halfWidth, centreY - quarterWidth), + Point(centreX + halfWidth, centreY - quarterWidth), + Point(centreX, centreY + halfWidth - quarterWidth), }; surface->Polygon(pts, ELEMENTS(pts), colourBG, colourBG); } -- cgit v1.2.3