preparing to generalize basic collission detection...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
acf4d90790
commit
751df786e5
@ -165,6 +165,9 @@ function(evt, id){
|
||||
// XXX constrain this to:
|
||||
// viewport -- DONE but needs to be smoother...
|
||||
// parent
|
||||
// element
|
||||
// ...might be a good idea to write a fast/generic containment
|
||||
// tester...
|
||||
// XXX might be a good idea to allow bounds to be:
|
||||
// string - css selector
|
||||
// element -
|
||||
@ -350,6 +353,37 @@ function(options={}){
|
||||
document.addEventListener('mouseup', handleMoveEnd) }
|
||||
|
||||
|
||||
// cmpRects(<rect>, <rect>)
|
||||
// -> 'contained'
|
||||
// -> 'contains'
|
||||
// -> 'intersect'
|
||||
// -> 'appart'
|
||||
// XXX should these pe separate checks -- speed???
|
||||
var cmpRects = function(rect, container){
|
||||
// XXX
|
||||
}
|
||||
var Containment = function(elem, parent){
|
||||
return Object.assign(
|
||||
this instanceof Containment ?
|
||||
obj
|
||||
: { __proto__: Containment.prototype },
|
||||
{
|
||||
elem,
|
||||
parent,
|
||||
}) }
|
||||
Containment.prototype = {
|
||||
// update rectangle data...
|
||||
update: function(){
|
||||
// XXX
|
||||
return self },
|
||||
check: function(){
|
||||
// XXX
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
// XXX add shift+arrow to select...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user