aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-27 08:48:56 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-27 08:48:56 +1100
commitc02f75227ef151af1b283e4436d06149e69679a7 (patch)
tree8a29be357829e31eeaeca18d5bd9e6b618d70c34 /src
parentec5b61c78f47269ba7f3015e31133e17e5de8fda (diff)
downloadscintilla-mirror-c02f75227ef151af1b283e4436d06149e69679a7.tar.gz
Add API for setting stroke width of indicators.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx13
-rw-r--r--src/Indicator.cxx1
-rw-r--r--src/Indicator.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 44c80451b..7ad889c23 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7518,6 +7518,19 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_INDICGETOUTLINEALPHA:
return (wParam <= INDICATOR_MAX) ? vs.indicators[wParam].outlineAlpha : 0;
+ case SCI_INDICSETSTROKEWIDTH:
+ if (wParam <= INDICATOR_MAX && lParam >= 0 && lParam <= 1000) {
+ vs.indicators[wParam].strokeWidth = lParam / 100.0f;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETSTROKEWIDTH:
+ if (wParam <= INDICATOR_MAX) {
+ return std::lround(vs.indicators[wParam].strokeWidth * 100);
+ }
+ break;
+
case SCI_SETINDICATORCURRENT:
pdoc->DecorationSetCurrentIndicator(static_cast<int>(wParam));
break;
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index 93bf68ed0..1ebc18b7f 100644
--- a/src/Indicator.cxx
+++ b/src/Indicator.cxx
@@ -36,7 +36,6 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
const int pixelDivisions = surface->PixelDivisions();
- const XYPOSITION strokeWidth = 1.0f;
const XYPOSITION halfWidth = strokeWidth / 2.0f;
const PRectangle rcAligned(PixelAlignOutside(rc, pixelDivisions));
diff --git a/src/Indicator.h b/src/Indicator.h
index 669d9a2d8..89cf1cdc5 100644
--- a/src/Indicator.h
+++ b/src/Indicator.h
@@ -33,6 +33,7 @@ public:
int fillAlpha;
int outlineAlpha;
int attributes;
+ XYPOSITION strokeWidth = 1.0f;
Indicator() noexcept : under(false), fillAlpha(30), outlineAlpha(50), attributes(0) {
}
Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) noexcept :