From 29738affee3f86e5a57354832c1a218aeaf457f2 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Mon, 21 Feb 2011 17:00:48 -0600 Subject: [PATCH] [Fixes bug #702156] Store the old cursor bounds so we can invalidate them on the next pass. --- Pinta.Tools/TextTool/TextTool.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Pinta.Tools/TextTool/TextTool.cs b/Pinta.Tools/TextTool/TextTool.cs index 244016153..cf78bd720 100644 --- a/Pinta.Tools/TextTool/TextTool.cs +++ b/Pinta.Tools/TextTool/TextTool.cs @@ -29,6 +29,7 @@ public class TextTool : BaseTool private Point clickPoint; private bool is_editing; private Rectangle old_bounds = Rectangle.Zero; + private Rectangle old_cursor_bounds = Rectangle.Zero; private TextEngine engine; @@ -649,7 +650,8 @@ private void StopEditing () private void RedrawText (bool showCursor, bool useToolLayer) { Cairo.ImageSurface surf; - + var invalidate_cursor = old_cursor_bounds; + if (!useToolLayer) surf = PintaCore.Workspace.ActiveDocument.CurrentLayer.Surface; else { @@ -690,6 +692,9 @@ private void RedrawText (bool showCursor, bool useToolLayer) g.Antialias = Cairo.Antialias.None; g.DrawLine (new Cairo.PointD (loc.X, loc.Y), new Cairo.PointD (loc.X, loc.Y + loc.Height), new Cairo.Color (0, 0, 0, 1), 1); + + loc.Inflate (2, 10); + old_cursor_bounds = loc; } g.Restore (); @@ -699,6 +704,7 @@ private void RedrawText (bool showCursor, bool useToolLayer) r.Inflate (10, 10); PintaCore.Workspace.Invalidate (old_bounds); + PintaCore.Workspace.Invalidate (invalidate_cursor); PintaCore.Workspace.Invalidate (r); old_bounds = r;