aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/MarginView.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-05-01 14:14:45 +1000
committerNeil <nyamatongwe@gmail.com>2018-05-01 14:14:45 +1000
commitf4c9e005de319d79fffae89e2695eb3d27005e85 (patch)
treec6dff56c891aa8eb33b0d659b4f5d39e20d6d80c /src/MarginView.cxx
parent086549b12567da2e3750dd7d45ff0f42bb5cb620 (diff)
downloadscintilla-mirror-f4c9e005de319d79fffae89e2695eb3d27005e85.tar.gz
Add IntegerRectangle to simplify drawing lines without casting.
Diffstat (limited to 'src/MarginView.cxx')
-rw-r--r--src/MarginView.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/MarginView.cxx b/src/MarginView.cxx
index 2b40b10bc..804ffcfcd 100644
--- a/src/MarginView.cxx
+++ b/src/MarginView.cxx
@@ -28,6 +28,7 @@
#include "StringCopy.h"
#include "Position.h"
+#include "IntegerRectangle.h"
#include "UniqueString.h"
#include "SplitVector.h"
#include "Partitioning.h"
@@ -58,16 +59,18 @@ void DrawWrapMarker(Surface *surface, PRectangle rcPlace,
bool isEndMarker, ColourDesired wrapColour) {
surface->PenColour(wrapColour);
+ const IntegerRectangle ircPlace(rcPlace);
+
enum { xa = 1 }; // gap before start
- const int w = static_cast<int>(rcPlace.right - rcPlace.left) - xa - 1;
+ const int w = ircPlace.Width() - xa - 1;
const bool xStraight = isEndMarker; // x-mirrored symbol for start marker
- const int x0 = static_cast<int>(xStraight ? rcPlace.left : rcPlace.right - 1);
- const int y0 = static_cast<int>(rcPlace.top);
+ const int x0 = xStraight ? ircPlace.left : ircPlace.right - 1;
+ const int y0 = ircPlace.top;
- const int dy = static_cast<int>(rcPlace.bottom - rcPlace.top) / 5;
- const int y = static_cast<int>(rcPlace.bottom - rcPlace.top) / 2 + dy;
+ const int dy = ircPlace.Height() / 5;
+ const int y = ircPlace.Height() / 2 + dy;
struct Relative {
Surface *surface;