[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: quarks:[2657] SenseWorld/contrainPoint.sc
- To: sc-dev@xxxxxxxxxxxxxxxx
- Subject: [sc-dev] SF.net SVN: quarks:[2657] SenseWorld/contrainPoint.sc
- From: nescivi@xxxxxxxxxxxxxxxxxxxxx
- Date: Thu, 21 Nov 2013 15:49:09 +0000
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:Subject:To:From:MIME-Version:Date; bh=tVgmAT8SoypJuk1AAX9jGMiFDxj7bfNlU2nKQUWcW+U=; b=qrMjqktSKovnZ+jB86QZ8ZScANFvs6wRPG6FBTX11LCiHglXmDioVLX0sQkh9/8dCFI0mdtbUbhXrFFf8UKDif/tyEsMzp4TPiwFhedZbdAQiWSS/rCddHtNjoO4+nU9+kaI5rUFmNBDTLTsVhCI5pGOIo/V6rV3G+sDmhmpbug=;
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=Content-Transfer-Encoding:Content-Type:Subject:To:From:MIME-Version:Date; bh=tVgmAT8SoypJuk1AAX9jGMiFDxj7bfNlU2nKQUWcW+U=; b=ZxFI/DaVvtJs3dVgZcPepcAU6zpWo+r+2bEg2P5vVe63VXqt3ABe5FBxTC+h6NhFEP+ncgIBA83m7PHJ/bR0X1DiPbYVrr/AiocDQhuRuyHO68sLhA/kq+W0OLF+i7oyDl7na6kAT3b7kGVNt7vwPJGf30lLfcnQd72Pm3oipEU=;
- List-id: SuperCollider developers mailing list <sc-devel.create.ucsb.edu>
- Reply-to: sc-dev@xxxxxxxxxxxxxxxx
- Sender: owner-sc-dev@xxxxxxxxxxxxxxxx
Revision: 2657
http://sourceforge.net/p/quarks/code/2657
Author: nescivi
Date: 2013-11-21 15:49:08 +0000 (Thu, 21 Nov 2013)
Log Message:
-----------
SenseWorld: make a version of constrain where point is copied, rather than changed
Modified Paths:
--------------
SenseWorld/contrainPoint.sc
Modified: SenseWorld/contrainPoint.sc
===================================================================
--- SenseWorld/contrainPoint.sc 2013-11-16 00:37:18 UTC (rev 2656)
+++ SenseWorld/contrainPoint.sc 2013-11-21 15:49:08 UTC (rev 2657)
@@ -7,4 +7,15 @@
y = y.clip( rect.top, rect.left + rect.height );
});
}
+
+ constrainCopy{ |rect|
+ var point = this.copy;
+ if ( rect.contains( this ).not,
+ {
+ point.x = point.x.clip( rect.left, rect.left + rect.width );
+ point.y = point.y.clip( rect.top, rect.left + rect.height );
+ });
+ ^point;
+ }
+
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/