From 6c9c12e367887cdf06f9b83974b249abffb4dfa8 Mon Sep 17 00:00:00 2001 From: FoggyFinder Date: Sat, 17 Aug 2019 18:25:22 +0300 Subject: [PATCH] fix of radical --- .../DisplayEditingExtensions.Radical.cs | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/CSharpMath.Editor/Extensions/DisplayEditingExtensions.Radical.cs b/CSharpMath.Editor/Extensions/DisplayEditingExtensions.Radical.cs index 14eba0634..314d87d50 100644 --- a/CSharpMath.Editor/Extensions/DisplayEditingExtensions.Radical.cs +++ b/CSharpMath.Editor/Extensions/DisplayEditingExtensions.Radical.cs @@ -19,19 +19,27 @@ public static MathListIndex IndexForPoint(this RadicalDisplay(this RadicalDisplay self, TypesettingContext context, MathListIndex index) where TFont : IFont { if (index.SubIndexType != MathListSubIndexType.None) throw Arg("The subindex must be none to get the closest point for it.", nameof(index)); - // draw a caret after the radical - return new PointF(self.DisplayBounds.Right, self.Position.Y); + + if (index.AtomIndex == self.Range.End) + // draw a caret after the radical + return new PointF(self.DisplayBounds.Right, self.Position.Y); + + return new PointF(self.DisplayBounds.Left, self.Position.Y); } public static void HighlightCharacterAt(this RadicalDisplay self, MathListIndex index, Color color) where TFont : IFont {