From 3f9ee9d5d565ff1fdb75e0f858018e0eb9d44a53 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 12 Nov 2020 13:18:29 +0100 Subject: [PATCH] fixed being unable to place the cursor at the end of a multi-line text --- HISTORY.md | 4 ++++ snap.html | 2 +- src/morphic.js | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index ebee7c63..204db616 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,10 @@ * **Notable Fixes:** * fixed a costume-shrinkWrap edgecase bug, thanks, Brian, for reporting it! * fixed dynamic costume-inheritance for PASTE and CUT + * fixed being unable to place the cursor at the end of a multi-line text + +### 2020-11-12 +* morphic: fixed being unable to place the cursor at the end of a multi-line text ### 2020-11-11 * objects: added meaningful defaults to blocks in the palette that didn't already have them diff --git a/snap.html b/snap.html index 87694f17..23ca5c36 100755 --- a/snap.html +++ b/snap.html @@ -5,7 +5,7 @@ Snap! 6.3.2 - dev - Build Your Own Blocks - + diff --git a/src/morphic.js b/src/morphic.js index 325cefec..7e17d5a9 100644 --- a/src/morphic.js +++ b/src/morphic.js @@ -1280,7 +1280,7 @@ /*global window, HTMLCanvasElement, FileReader, Audio, FileList, Map*/ -var morphicVersion = '2020-November-02'; +var morphicVersion = '2020-November-12'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = true; @@ -9438,7 +9438,7 @@ TextMorph.prototype.slotAt = function (aPoint) { charX = 0; } columnLength = this.lines[row - 1].length; - while (col < columnLength - 2 && aPoint.x - this.left() > charX) { + while (col < columnLength - 1 && aPoint.x - this.left() > charX) { charX += ctx.measureText(this.lines[row - 1][col]).width; col += 1; }