From 63fcc3edaf7ca501fdf7d6d98bb0a5de24939f71 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Thu, 19 Mar 2020 08:53:15 +1100 Subject: Backport: Feature [feature-requests:1302] Add IsCaretVisible to simplify DrawCarets. Backport of changeset 8010:4b365fa302a2. --- src/ViewStyle.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 6ec980af4..43b48544c 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -549,6 +549,10 @@ bool ViewStyle::IsBlockCaretStyle() const noexcept { (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0; } +bool ViewStyle::IsCaretVisible() const noexcept { + return caretWidth > 0 && caretStyle != CARETSTYLE_INVISIBLE; +} + bool ViewStyle::DrawCaretInsideSelection(bool inOverstrike, bool imeCaretBlockOverride) const noexcept { if (caretStyle & CARETSTYLE_BLOCK_AFTER) return false; -- cgit v1.2.3