Help us understand the problem. What is going on with this article?

Swiffy v7.2のテキスト改行がおかしくなる件

More than 1 year has passed since last update.

Google Swiffyは死にました。この記事はゴミになりました。

Swiffyのテキスト改行がおかしくなる件
Swiffyって何? → Swiffy | Google Developers

↓こういう状態
(左がバグ状態、右が修正済みの状態です)
20150716-000416-8000.png

とりあえずどこを直せばいいのか書いておく。

runtime.js
    g.Ix = function(a, b, c, d) {
        for (var e = this.Zo(), f = 0; f < a.length;) {
            for (var h = f + 1, k = a.length, m; k > h;) {
                var n = h + (k - h) / 2,
                    n = Math.ceil(n);
                m = a.substring(f, n);
                e.measureText(m).width <= b - c ? h = n : k = n - 1
            }
// console.log('"' + a + '".substr('+f+','+h+'); => ' + a.substr(f, h));
// console.log('"' + a + '".substring('+f+','+h+'); => ' + a.substring(f, h));

//            d.push(a.substr(f, h)); // ← この行がバグ
            d.push(a.substring(f, h)); // これが本来期待する動作
            f = h;
            c = 0
        }
    };

substrとsubstringを勘違いしてただけっていうね…
余談ですが、整形した時に2万行超えてて発狂しそうになりました。(+コードの難読化)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away