diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 812b0a7b4..e80ec647b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -289,13 +289,17 @@ void Editor::RefreshStyleData() { } } +bool Editor::HasMarginWindow() const noexcept { + return wMargin.Created(); +} + Point Editor::GetVisibleOriginInMain() const { return Point(0, 0); } PointDocument Editor::DocumentPointFromView(Point ptView) const { PointDocument ptDocument(ptView); - if (wMargin.GetID()) { + if (HasMarginWindow()) { const Point ptOrigin = GetVisibleOriginInMain(); ptDocument.x += ptOrigin.x; ptDocument.y += ptOrigin.y; @@ -307,7 +311,7 @@ PointDocument Editor::DocumentPointFromView(Point ptView) const { } Sci::Line Editor::TopLineOfMain() const noexcept { - if (wMargin.GetID()) + if (HasMarginWindow()) return 0; else return topLine; @@ -485,7 +489,7 @@ void Editor::Redraw() { //Platform::DebugPrintf("Redraw all\n"); const PRectangle rcClient = GetClientRectangle(); wMain.InvalidateRectangle(rcClient); - if (wMargin.GetID()) { + if (HasMarginWindow()) { wMargin.InvalidateAll(); } else if (paintState == PaintState::notPainting) { redrawPendingText = true; @@ -494,12 +498,12 @@ void Editor::Redraw() { void Editor::RedrawSelMargin(Sci::Line line, bool allAfter) { const bool markersInText = vs.maskInLine || vs.maskDrawInText; - if (!wMargin.GetID() || markersInText) { // May affect text area so may need to abandon and retry + if (!HasMarginWindow() || markersInText) { // May affect text area so may need to abandon and retry if (AbandonPaint()) { return; } } - if (wMargin.GetID() && markersInText) { + if (HasMarginWindow() && markersInText) { Redraw(); return; } @@ -532,7 +536,7 @@ void Editor::RedrawSelMargin(Sci::Line line, bool allAfter) { if (rcMarkers.Empty()) return; } - if (wMargin.GetID()) { + if (HasMarginWindow()) { const Point ptOrigin = GetVisibleOriginInMain(); rcMarkers.Move(-ptOrigin.x, -ptOrigin.y); wMargin.InvalidateRectangle(rcMarkers); @@ -5271,7 +5275,7 @@ bool Editor::PaintContains(PRectangle rc) { } bool Editor::PaintContainsMargin() { - if (wMargin.GetID()) { + if (HasMarginWindow()) { // With separate margin view, paint of text view // never contains margin. return false; |