From 3da97fcc835e1abbfe60872eacb64d8c9197454f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 24 May 2021 17:12:02 +0200 Subject: [PATCH] fixed UnderlineCode being a font code, making it end in the wrong places --- MLEM/Formatting/Codes/ShadowCode.cs | 2 +- MLEM/Formatting/Codes/UnderlineCode.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MLEM/Formatting/Codes/ShadowCode.cs b/MLEM/Formatting/Codes/ShadowCode.cs index d7dba53..61055c4 100644 --- a/MLEM/Formatting/Codes/ShadowCode.cs +++ b/MLEM/Formatting/Codes/ShadowCode.cs @@ -26,7 +26,7 @@ namespace MLEM.Formatting.Codes { /// public override bool EndsHere(Code other) { - return base.EndsHere(other) || other is ResetFormattingCode; + return other is ShadowCode || other is ResetFormattingCode; } } diff --git a/MLEM/Formatting/Codes/UnderlineCode.cs b/MLEM/Formatting/Codes/UnderlineCode.cs index 1a53004..ddee86c 100644 --- a/MLEM/Formatting/Codes/UnderlineCode.cs +++ b/MLEM/Formatting/Codes/UnderlineCode.cs @@ -7,13 +7,13 @@ using MLEM.Misc; namespace MLEM.Formatting.Codes { /// - public class UnderlineCode : FontCode { + public class UnderlineCode : Code { private readonly float thickness; private readonly float yOffset; /// - public UnderlineCode(Match match, Regex regex, float thickness, float yOffset) : base(match, regex, null) { + public UnderlineCode(Match match, Regex regex, float thickness, float yOffset) : base(match, regex) { this.thickness = thickness; this.yOffset = yOffset; } @@ -31,7 +31,7 @@ namespace MLEM.Formatting.Codes { /// public override bool EndsHere(Code other) { - return base.EndsHere(other) || other is ResetFormattingCode; + return other is UnderlineCode || other is ResetFormattingCode; } }