Permalink
Browse files

added antialiasing option.

  • Loading branch information...
1 parent c4350f5 commit a305238f23350671c5b6e1fc2a29da57692beac4 Andor Salga committed Jun 27, 2011
Showing with 8 additions and 7 deletions.
  1. +1 −1 demos/mickey/mickey.js
  2. +1 −1 example.js
  3. +5 −4 psapi.js
  4. +1 −1 tests/resize/acorn.js
@@ -64,7 +64,7 @@ function render() {
function start(){
ps = new PointStream();
- ps.setup(document.getElementById('canvas'));
+ ps.setup(document.getElementById('canvas'), {"antialias":false});
ps.pointSize(8);
ps.background([0.3, 0.5, 0.6, 0.6]);
View
@@ -2,7 +2,7 @@ var ps, acorn;
function start(){
ps = new PointStream();
- ps.setup(document.getElementById('canvas'));
+ ps.setup(document.getElementById('canvas'),{"antialias":true});
ps.pointSize(5);
ps.onRender = function(){
ps.translate(0, 0, -25);
View
@@ -1282,7 +1282,7 @@ var PointStream = (function() {
@param {Number} pWidth
@param {Number} pHeight
*/
- this.resize = function(pWidth, pHeight){
+ this.resize = function(pWidth, pHeight, ctxAttribs){
// override the canvas attributes
canvas.setAttribute("width", pWidth);
canvas.setAttribute("height", pHeight);
@@ -1295,7 +1295,7 @@ var PointStream = (function() {
for(var i = 0; i < contextNames.length; i++){
try{
- ctx = canvas.getContext(contextNames[i], {"antialias":false});
+ ctx = canvas.getContext(contextNames[i], ctxAttribs);
if(ctx){
break;
}
@@ -1646,7 +1646,7 @@ var PointStream = (function() {
@param {canvas} cvs
*/
- this.setup = function(cvs){
+ this.setup = function(cvs, ctxAttribs){
canvas = cvs;
//browser = getUserAgent(navigator.userAgent);
@@ -1665,7 +1665,8 @@ var PointStream = (function() {
cvsHeight = 150;
}
- this.resize(cvsWidth, cvsHeight);
+ // This will create our graphics context.
+ this.resize(cvsWidth, cvsHeight, ctxAttribs);
ctx.enable(ctx.DEPTH_TEST);
@@ -69,7 +69,7 @@ function render(){
function start(){
ps = new PointStream();
- ps.setup(document.getElementById('canvas'));
+ ps.setup(document.getElementById('canvas'), {"antialias":true});
// forse styles to be set
resize();

0 comments on commit a305238

Please sign in to comment.