aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ViewStyle.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r--src/ViewStyle.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index 58dbf167b..e12620c96 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -445,6 +445,17 @@ int ViewStyle::ExternalMarginWidth() const {
return marginInside ? 0 : fixedColumnWidth;
}
+int ViewStyle::MarginFromLocation(Point pt) const {
+ int margin = -1;
+ int x = textStart - fixedColumnWidth;
+ for (size_t i = 0; i < ms.size(); i++) {
+ if ((pt.x >= x) && (pt.x < x + ms[i].width))
+ margin = static_cast<int>(i);
+ x += ms[i].width;
+ }
+ return margin;
+}
+
bool ViewStyle::ValidStyle(size_t styleIndex) const {
return styleIndex < styles.size();
}