mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Template/Update (Part 47)
* split global.js into its components, so it can be reasonably processed by setup * make reputation requirements configurable * move Markup and Locale back into global.js (removed associated build scripts) * extend Icon to display iconId in lightbox popup
This commit is contained in:
35
setup/tools/filegen/templates/global.js/rectangle.js
Normal file
35
setup/tools/filegen/templates/global.js/rectangle.js
Normal file
@@ -0,0 +1,35 @@
|
||||
function Rectangle(left, top, width, height)
|
||||
{
|
||||
this.l = left;
|
||||
this.t = top;
|
||||
this.r = left + width;
|
||||
this.b = top + height;
|
||||
}
|
||||
|
||||
Rectangle.prototype = {
|
||||
|
||||
intersectWith: function(rect)
|
||||
{
|
||||
var result = !(
|
||||
this.l >= rect.r || rect.l >= this.r ||
|
||||
this.t >= rect.b || rect.t >= this.b
|
||||
);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
contains: function(rect)
|
||||
{
|
||||
var result = (
|
||||
this.l <= rect.l && this.t <= rect.t &&
|
||||
this.r >= rect.r && this.b >= rect.b
|
||||
);
|
||||
return result;
|
||||
},
|
||||
|
||||
containedIn: function(rect)
|
||||
{
|
||||
return rect.contains(this);
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user