{"action":"created","comment":{"url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/comments/31021706","id":31021706,"diff_hunk":"@@ -477,26 +512,39 @@ public void measure(BaseDanmaku danmaku) {\n             applyPaintConfig(danmaku, paint, false);\r\n         }\r\n     }\r\n-    \r\n+\r\n     private void calcPaintWH(BaseDanmaku danmaku, TextPaint paint) {\r\n         float w = 0;\r\n         Float textHeight = getTextHeight(paint);\r\n+\r\n         if (danmaku.lines == null) {\r\n-            w = danmaku.text == null ? 0 : paint.measureText(danmaku.text);\r\n-            setDanmakuPaintWidthAndHeight(danmaku,w,textHeight);\r\n+            //w = danmaku.text == null ? 0 : paint.measureText((String)danmaku.text);\r\n+            //setDanmakuPaintWidthAndHeight(danmaku,w,textHeight);\r\n+            CharSequence text = danmaku.text;\r\n+            if (text == null) {\r\n+                w = 0;\r\n+            } else if (text instanceof String) {\r\n+                w = paint.measureText((String) danmaku.text);\r\n+            } else if (text instanceof SpannableStringBuilder) {\r","path":"DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/AndroidDisplayer.java","position":316,"original_position":316,"commit_id":"a1e427599d29e6682fe54a80fba4ab86607f5f2f","original_commit_id":"a1e427599d29e6682fe54a80fba4ab86607f5f2f","user":{"login":"ctiao","id":3433776,"avatar_url":"https://avatars.githubusercontent.com/u/3433776?v=3","gravatar_id":"","url":"https://api.github.com/users/ctiao","html_url":"https://github.com/ctiao","followers_url":"https://api.github.com/users/ctiao/followers","following_url":"https://api.github.com/users/ctiao/following{/other_user}","gists_url":"https://api.github.com/users/ctiao/gists{/gist_id}","starred_url":"https://api.github.com/users/ctiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctiao/subscriptions","organizations_url":"https://api.github.com/users/ctiao/orgs","repos_url":"https://api.github.com/users/ctiao/repos","events_url":"https://api.github.com/users/ctiao/events{/privacy}","received_events_url":"https://api.github.com/users/ctiao/received_events","type":"User","site_admin":false},"body":" private final static boolean isSpannable(BaseDanmaku danmaku) {\r\n     return danmaku.text instanceof Spanned || danmaku.text instanceof Spannable;\r\n}\r\ntext instanceof SpannableStringBuilder可以改成上面的条件,支持更多Span类型实例,如果单判断SpannableStringBuilder，那没法支持SpannedString和SpannableString","created_at":"2015-05-26T10:39:59Z","updated_at":"2015-05-26T10:39:59Z","html_url":"https://github.com/Bilibili/DanmakuFlameMaster/pull/97#discussion_r31021706","pull_request_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/comments/31021706"},"html":{"href":"https://github.com/Bilibili/DanmakuFlameMaster/pull/97#discussion_r31021706"},"pull_request":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97","id":36188243,"html_url":"https://github.com/Bilibili/DanmakuFlameMaster/pull/97","diff_url":"https://github.com/Bilibili/DanmakuFlameMaster/pull/97.diff","patch_url":"https://github.com/Bilibili/DanmakuFlameMaster/pull/97.patch","issue_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues/97","number":97,"state":"open","locked":false,"title":"增加图文混排支持","user":{"login":"DukeLee1989","id":6382547,"avatar_url":"https://avatars.githubusercontent.com/u/6382547?v=3","gravatar_id":"","url":"https://api.github.com/users/DukeLee1989","html_url":"https://github.com/DukeLee1989","followers_url":"https://api.github.com/users/DukeLee1989/followers","following_url":"https://api.github.com/users/DukeLee1989/following{/other_user}","gists_url":"https://api.github.com/users/DukeLee1989/gists{/gist_id}","starred_url":"https://api.github.com/users/DukeLee1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DukeLee1989/subscriptions","organizations_url":"https://api.github.com/users/DukeLee1989/orgs","repos_url":"https://api.github.com/users/DukeLee1989/repos","events_url":"https://api.github.com/users/DukeLee1989/events{/privacy}","received_events_url":"https://api.github.com/users/DukeLee1989/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-26T10:21:45Z","updated_at":"2015-05-26T10:39:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cefecfc86c68d9a2a9e0ea2886cb05c0ffdd9fea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97/commits","review_comments_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97/comments","review_comment_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues/97/comments","statuses_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/statuses/a1e427599d29e6682fe54a80fba4ab86607f5f2f","head":{"label":"DukeLee1989:master","ref":"master","sha":"a1e427599d29e6682fe54a80fba4ab86607f5f2f","user":{"login":"DukeLee1989","id":6382547,"avatar_url":"https://avatars.githubusercontent.com/u/6382547?v=3","gravatar_id":"","url":"https://api.github.com/users/DukeLee1989","html_url":"https://github.com/DukeLee1989","followers_url":"https://api.github.com/users/DukeLee1989/followers","following_url":"https://api.github.com/users/DukeLee1989/following{/other_user}","gists_url":"https://api.github.com/users/DukeLee1989/gists{/gist_id}","starred_url":"https://api.github.com/users/DukeLee1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DukeLee1989/subscriptions","organizations_url":"https://api.github.com/users/DukeLee1989/orgs","repos_url":"https://api.github.com/users/DukeLee1989/repos","events_url":"https://api.github.com/users/DukeLee1989/events{/privacy}","received_events_url":"https://api.github.com/users/DukeLee1989/received_events","type":"User","site_admin":false},"repo":{"id":36287746,"name":"DanmakuFlameMaster","full_name":"DukeLee1989/DanmakuFlameMaster","owner":{"login":"DukeLee1989","id":6382547,"avatar_url":"https://avatars.githubusercontent.com/u/6382547?v=3","gravatar_id":"","url":"https://api.github.com/users/DukeLee1989","html_url":"https://github.com/DukeLee1989","followers_url":"https://api.github.com/users/DukeLee1989/followers","following_url":"https://api.github.com/users/DukeLee1989/following{/other_user}","gists_url":"https://api.github.com/users/DukeLee1989/gists{/gist_id}","starred_url":"https://api.github.com/users/DukeLee1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DukeLee1989/subscriptions","organizations_url":"https://api.github.com/users/DukeLee1989/orgs","repos_url":"https://api.github.com/users/DukeLee1989/repos","events_url":"https://api.github.com/users/DukeLee1989/events{/privacy}","received_events_url":"https://api.github.com/users/DukeLee1989/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DukeLee1989/DanmakuFlameMaster","description":"大弹幕时代来临了,这里是Android上最好的开源弹幕引擎·烈焰弹幕使 ～ 被弹幕吞噬吧! ","fork":true,"url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster","forks_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/forks","keys_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/teams","hooks_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/hooks","issue_events_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/issues/events{/number}","events_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/events","assignees_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/assignees{/user}","branches_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/branches{/branch}","tags_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/tags","blobs_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/git/refs{/sha}","trees_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/statuses/{sha}","languages_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/languages","stargazers_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/stargazers","contributors_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/contributors","subscribers_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/subscribers","subscription_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/subscription","commits_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/commits{/sha}","git_commits_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/git/commits{/sha}","comments_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/comments{/number}","issue_comment_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/issues/comments{/number}","contents_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/contents/{+path}","compare_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/merges","archive_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/downloads","issues_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/issues{/number}","pulls_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/pulls{/number}","milestones_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/milestones{/number}","notifications_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/labels{/name}","releases_url":"https://api.github.com/repos/DukeLee1989/DanmakuFlameMaster/releases{/id}","created_at":"2015-05-26T10:06:25Z","updated_at":"2015-05-26T10:06:25Z","pushed_at":"2015-05-26T10:20:07Z","git_url":"git://github.com/DukeLee1989/DanmakuFlameMaster.git","ssh_url":"git@github.com:DukeLee1989/DanmakuFlameMaster.git","clone_url":"https://github.com/DukeLee1989/DanmakuFlameMaster.git","svn_url":"https://github.com/DukeLee1989/DanmakuFlameMaster","homepage":"http://app.bilibili.com/","size":5361,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Bilibili:master","ref":"master","sha":"ebb918e588a09ff420ebbbe33df88063c12b1b17","user":{"login":"Bilibili","id":12002442,"avatar_url":"https://avatars.githubusercontent.com/u/12002442?v=3","gravatar_id":"","url":"https://api.github.com/users/Bilibili","html_url":"https://github.com/Bilibili","followers_url":"https://api.github.com/users/Bilibili/followers","following_url":"https://api.github.com/users/Bilibili/following{/other_user}","gists_url":"https://api.github.com/users/Bilibili/gists{/gist_id}","starred_url":"https://api.github.com/users/Bilibili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bilibili/subscriptions","organizations_url":"https://api.github.com/users/Bilibili/orgs","repos_url":"https://api.github.com/users/Bilibili/repos","events_url":"https://api.github.com/users/Bilibili/events{/privacy}","received_events_url":"https://api.github.com/users/Bilibili/received_events","type":"Organization","site_admin":false},"repo":{"id":12035487,"name":"DanmakuFlameMaster","full_name":"Bilibili/DanmakuFlameMaster","owner":{"login":"Bilibili","id":12002442,"avatar_url":"https://avatars.githubusercontent.com/u/12002442?v=3","gravatar_id":"","url":"https://api.github.com/users/Bilibili","html_url":"https://github.com/Bilibili","followers_url":"https://api.github.com/users/Bilibili/followers","following_url":"https://api.github.com/users/Bilibili/following{/other_user}","gists_url":"https://api.github.com/users/Bilibili/gists{/gist_id}","starred_url":"https://api.github.com/users/Bilibili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bilibili/subscriptions","organizations_url":"https://api.github.com/users/Bilibili/orgs","repos_url":"https://api.github.com/users/Bilibili/repos","events_url":"https://api.github.com/users/Bilibili/events{/privacy}","received_events_url":"https://api.github.com/users/Bilibili/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bilibili/DanmakuFlameMaster","description":"大弹幕时代来临了,这里是Android上最好的开源弹幕引擎·烈焰弹幕使 ～ 被弹幕吞噬吧! ","fork":false,"url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster","forks_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/forks","keys_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/teams","hooks_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/hooks","issue_events_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues/events{/number}","events_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/events","assignees_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/assignees{/user}","branches_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/branches{/branch}","tags_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/tags","blobs_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/statuses/{sha}","languages_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/languages","stargazers_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/stargazers","contributors_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/contributors","subscribers_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/subscribers","subscription_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/subscription","commits_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/contents/{+path}","compare_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/merges","archive_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/downloads","issues_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues{/number}","pulls_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls{/number}","milestones_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/milestones{/number}","notifications_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/labels{/name}","releases_url":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/releases{/id}","created_at":"2013-08-11T12:18:50Z","updated_at":"2015-05-26T09:40:02Z","pushed_at":"2015-05-26T10:21:45Z","git_url":"git://github.com/Bilibili/DanmakuFlameMaster.git","ssh_url":"git@github.com:Bilibili/DanmakuFlameMaster.git","clone_url":"https://github.com/Bilibili/DanmakuFlameMaster.git","svn_url":"https://github.com/Bilibili/DanmakuFlameMaster","homepage":"http://app.bilibili.com/","size":5361,"stargazers_count":1314,"watchers_count":1314,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":372,"mirror_url":null,"open_issues_count":13,"forks":372,"open_issues":13,"watchers":1314,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97"},"html":{"href":"https://github.com/Bilibili/DanmakuFlameMaster/pull/97"},"issue":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues/97"},"comments":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/Bilibili/DanmakuFlameMaster/statuses/a1e427599d29e6682fe54a80fba4ab86607f5f2f"}}}}