Skip to content

Commit b4033c4

Browse files
author
Ben D'Angelo
committed
fixes
1 parent 50de549 commit b4033c4

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

spec/javascripts/src/core/query_spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ describe('query', function(){
180180

181181
var e = re.e();
182182

183+
q.push(10);
183184
q.push(e);
184185

185186
//add in

src/display/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ re.c('draw')
133133
*/
134134
visible:function(){
135135

136-
return this.drawable && re.screen.hit(this.posX, this.posY, this.sizeX, this.sizeY, this.regX, this.regY);
136+
return this.drawable && re.screen.hit(this.posX, this.posY, this.sizeX, this.sizeY);
137137

138138
}
139139

src/math/bisect.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ re.c('bisect')
2828
return this.toTileY(bi, width, sizeX) * sizeY;
2929
},
3030

31-
toTileX:function(bi, width, size){
31+
toTileX:function(bi, width, sizeX){
3232

33-
return bi % (width / size) | 0;
33+
return bi % (width / sizeX) | 0;
3434
},
3535

36-
toTileY:function(bi, width, size){
37-
return (bi * size) / (width - 0.1) | 0;
36+
toTileY:function(bi, width, sizeX){
37+
return (bi * sizeX) / (width - 0.1) | 0;
3838
},
3939

4040
/*

src/math/hit.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,20 @@ re.c('hit')
1414
k.hit(entity);
1515
1616
*/
17-
hit:function(x, y, w, h, rx, ry){
17+
hit:function(x, y, w, h){
1818
if(re.is(x, 'object')){
1919
y = x.posY || x.y;
2020
w = x.sizeX || x.w;
2121
h = x.sizeY || x.h;
22-
rx = x.regX || 0;
23-
ry = x.regY || 0;
2422
x = x.posX || x.x;
2523
}
2624

27-
rx = rx || 0;
28-
ry = ry || 0;
29-
var regX = this.regX || 0;
30-
var regY = this.regY || 0;
31-
3225
return !
3326
(
34-
x + rx > this.posX + this.sizeX - regX ||
35-
x + w - rx < this.posX + regX ||
36-
y + ry > this.posY + this.sizeY - regY ||
37-
y + h - ry < this.posY + regY
27+
x > this.posX + this.sizeX ||
28+
x + w < this.posX ||
29+
y > this.posY + this.sizeY ||
30+
y + h < this.posY
3831
);
3932
}
4033

0 commit comments

Comments
 (0)