diff options
author | Zufu Liu <unknown> | 2021-08-27 08:21:16 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2021-08-27 08:21:16 +1000 |
commit | 6a4ba450a78154a10360a43b6f36cb2c11d1c955 (patch) | |
tree | 12f7ff8eabd79576205af9f4517e2d7bd2252e1b | |
parent | bb75e40bca7a6d81eb4070a7b67950119dc4b8b5 (diff) | |
download | scintilla-mirror-6a4ba450a78154a10360a43b6f36cb2c11d1c955.tar.gz |
Feature [feature-requests:#841] Remove hotspot from LineLayout and rely on
reference to model.
-rw-r--r-- | src/EditModel.h | 1 | ||||
-rw-r--r-- | src/EditView.cxx | 7 | ||||
-rw-r--r-- | src/Editor.cxx | 4 | ||||
-rw-r--r-- | src/Editor.h | 1 | ||||
-rw-r--r-- | src/PositionCache.cxx | 1 | ||||
-rw-r--r-- | src/PositionCache.h | 3 |
6 files changed, 3 insertions, 14 deletions
diff --git a/src/EditModel.h b/src/EditModel.h index 16a3d1c9f..0887b86ca 100644 --- a/src/EditModel.h +++ b/src/EditModel.h @@ -64,7 +64,6 @@ public: virtual Sci::Line TopLineOfMain() const = 0; virtual Point GetVisibleOriginInMain() const = 0; virtual Sci::Line LinesOnScreen() const = 0; - virtual Range GetHotSpotRange() const noexcept = 0; bool BidirectionalEnabled() const noexcept; bool BidirectionalR2L() const noexcept; void SetDefaultFoldDisplayText(const char *text); diff --git a/src/EditView.cxx b/src/EditView.cxx index b0b87a9b1..0f69dd7b3 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1766,7 +1766,7 @@ void EditView::DrawBackground(Surface *surface, const EditModel &model, const Vi rcSegment.right = rcLine.right; const InSelection inSelection = hideSelection ? InSelection::inNone : model.sel.CharacterInSelection(iDoc); - const bool inHotspot = (ll->hotspot.Valid()) && ll->hotspot.ContainsCharacter(iDoc); + const bool inHotspot = model.hotspot.Valid() && model.hotspot.ContainsCharacter(iDoc); ColourRGBA textBack = TextBackground(model, vsDraw, ll, background, inSelection, inHotspot, ll->styles[i], i); if (ts.representation) { @@ -1977,7 +1977,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi ColourRGBA textFore = vsDraw.styles[styleMain].fore; const Font *textFont = vsDraw.styles[styleMain].font.get(); // Hot-spot foreground - const bool inHotspot = (ll->hotspot.Valid()) && ll->hotspot.ContainsCharacter(iDoc); + const bool inHotspot = model.hotspot.Valid() && model.hotspot.ContainsCharacter(iDoc); if (inHotspot) { if (vsDraw.ElementColour(Element::HotSpotActive)) textFore = *vsDraw.ElementColour(Element::HotSpotActive); @@ -2124,7 +2124,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi } } } - if (ll->hotspot.Valid() && vsDraw.hotspotUnderline && ll->hotspot.ContainsCharacter(iDoc)) { + if (inHotspot && vsDraw.hotspotUnderline) { PRectangle rcUL = rcSegment; rcUL.top = rcUL.top + vsDraw.maxAscent + 1; rcUL.bottom = rcUL.top + 1; @@ -2411,7 +2411,6 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, PRectan if (ll) { ll->containsCaret = !hideSelection && (lineDoc == lineCaret) && (ll->lines == 1 || !vsDraw.caretLine.subLine || ll->InLine(caretOffset, subLine)); - ll->hotspot = model.GetHotSpotRange(); PRectangle rcLine = rcTextArea; rcLine.top = static_cast<XYPOSITION>(ypos); diff --git a/src/Editor.cxx b/src/Editor.cxx index 1fed61e36..a17ad4dd8 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4798,10 +4798,6 @@ void Editor::SetHotSpotRange(const Point *pt) { } } -Range Editor::GetHotSpotRange() const noexcept { - return hotspot; -} - void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, KeyMod modifiers) { if (ptMouseLast != pt) { DwellEnd(true); diff --git a/src/Editor.h b/src/Editor.h index d6ee0a80f..f3e23ef5b 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -585,7 +585,6 @@ protected: // ScintillaBase subclass needs access to much of Editor bool PositionIsHotspot(Sci::Position position) const; bool PointIsHotspot(Point pt); void SetHotSpotRange(const Point *pt); - Range GetHotSpotRange() const noexcept override; void SetHoverIndicatorPosition(Sci::Position position); void SetHoverIndicatorPoint(Point pt); diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index fda736cc7..d24b1ed8d 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -71,7 +71,6 @@ LineLayout::LineLayout(Sci::Line lineNumber_, int maxLineLength_) : containsCaret(false), edgeColumn(0), bracePreviousStyles{}, - hotspot(0,0), widthLine(wrapWidthInfinite), lines(1), wrapIndent(0) { diff --git a/src/PositionCache.h b/src/PositionCache.h index 0eefaca78..3dc68a0fd 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -79,9 +79,6 @@ public: std::unique_ptr<BidiData> bidiData; - // Hotspot support - Range hotspot; - // Wrapped line support int widthLine; int lines; |