Gisellameloni / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

double space causes problem in text-tool #1189

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
using 2.6.

use texttool and enter 'A', sp, sp will cause some internal error.

#text can accept trailing spaces, but <text> doesn't accept 
trailing spaces so getStartPositionOfChar or other element may fail.

Not complete fixment, but I suggest to remove trailing spaces as
following:

            $('#text').keyup(function () {
                // 空白が続いていると、エラーになる
                // ここで重複する空白を除く
                if (this.value.indexOf("  ") >= 0) {
                    this.value = this.value.replace(/  /g, " ");
                }

                svgCanvas.setTextContent(this.value);
            });

Original issue reported on code.google.com by psh....@gmail.com on 25 Feb 2014 at 3:49