Skip to content

Commit ec3799b

Browse files
committed
Merge pull request #1 from jabbany/master
merge Owner's changes
2 parents 6150321 + 35dd341 commit ec3799b

File tree

7 files changed

+28
-15
lines changed

7 files changed

+28
-15
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: node_js
2+
sudo: false
23
node_js:
34
- "0.10"
45
before_install:

build/CommentCoreLibrary.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,23 +824,26 @@ var CommentManager = (function() {
824824
};
825825
CommentManager.prototype.init = function(){
826826
this.setBounds();
827-
if(this.filter == null)
827+
if(this.filter == null) {
828828
this.filter = new CommentFilter(); //Only create a filter if none exist
829+
}
829830
};
830831
CommentManager.prototype.time = function(time){
831832
time = time - 1;
832833
if(this.position >= this.timeline.length || Math.abs(this.lastPos - time) >= 2000){
833834
this.seek(time);
834835
this.lastPos = time;
835-
if(this.timeline.length <= this.position)
836+
if(this.timeline.length <= this.position) {
836837
return;
838+
}
837839
}else{
838840
this.lastPos = time;
839841
}
840842
for(;this.position < this.timeline.length;this.position++){
841-
if(this.options.limit > 0 && this.runline.length > this.limiter) break;
842843
if(this.timeline[this.position]['stime']<=time){
843-
if(this.validate(this.timeline[this.position])){
844+
if(this.options.limit > 0 && this.runline.length > this.limiter) {
845+
continue; // Skip comments but still move the position pointer
846+
} else if(this.validate(this.timeline[this.position])){
844847
this.send(this.timeline[this.position]);
845848
}
846849
}else{

build/CommentCoreLibrary.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/scripting/Host.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,9 @@ var CCLScripting = function(workerUrl){
900900
cG = Math.floor((filter.params.color % 65536)/256),
901901
cB = filter.params.color % 256;
902902
var cMatrix = [
903-
0,0,0,cR,0,
904-
0,0,0,cG,0,
905-
0,0,0,cB,0,
903+
0,0,0,cR/256,0,
904+
0,0,0,cG/256,0,
905+
0,0,0,cB/256,0,
906906
0,0,0,1,0,
907907
];
908908
dFilter.appendChild(__("feColorMatrix",{

docs/CommentManager.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
管理器的弹幕是否在运行。`false`表示没有在运行,`true`表示在运行。可以通过 start/stop 控制。这
2020
个参数只反映运行列表里面弹幕的运行状态,而不是视频的。
2121

22+
### width &lt;Number&gt;
23+
舞台的长度像素值,用于计算弹幕位置。此数只有在 init 之后才有效。
24+
25+
### height &lt;Number&gt;
26+
舞台的高度像素值,用于计算弹幕位置。此数只有在 init 之后才有效。
27+
2228
## Methods 方法
2329

2430
### init()

src/CommentCoreLibrary.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,26 @@ var CommentManager = (function() {
159159
};
160160
CommentManager.prototype.init = function(){
161161
this.setBounds();
162-
if(this.filter == null)
162+
if(this.filter == null) {
163163
this.filter = new CommentFilter(); //Only create a filter if none exist
164+
}
164165
};
165166
CommentManager.prototype.time = function(time){
166167
time = time - 1;
167168
if(this.position >= this.timeline.length || Math.abs(this.lastPos - time) >= 2000){
168169
this.seek(time);
169170
this.lastPos = time;
170-
if(this.timeline.length <= this.position)
171+
if(this.timeline.length <= this.position) {
171172
return;
173+
}
172174
}else{
173175
this.lastPos = time;
174176
}
175177
for(;this.position < this.timeline.length;this.position++){
176-
if(this.options.limit > 0 && this.runline.length > this.limiter) break;
177178
if(this.timeline[this.position]['stime']<=time){
178-
if(this.validate(this.timeline[this.position])){
179+
if(this.options.limit > 0 && this.runline.length > this.limiter) {
180+
continue; // Skip comments but still move the position pointer
181+
} else if(this.validate(this.timeline[this.position])){
179182
this.send(this.timeline[this.position]);
180183
}
181184
}else{

src/scripting/Unpacker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,9 @@
599599
cG = Math.floor((filter.params.color % 65536)/256),
600600
cB = filter.params.color % 256;
601601
var cMatrix = [
602-
0,0,0,cR,0,
603-
0,0,0,cG,0,
604-
0,0,0,cB,0,
602+
0,0,0,cR/256,0,
603+
0,0,0,cG/256,0,
604+
0,0,0,cB/256,0,
605605
0,0,0,1,0,
606606
];
607607
dFilter.appendChild(__("feColorMatrix",{

0 commit comments

Comments
 (0)