Skip to content

Instantly share code, notes, and snippets.

@notmasteryet
Created July 13, 2010 02:56
Show Gist options
  • Save notmasteryet/473392 to your computer and use it in GitHub Desktop.
Save notmasteryet/473392 to your computer and use it in GitHub Desktop.
var code = new Processing.Sketch(function(processing) {
function setup() {
processing.size(300, 300);
processing.noStroke();
processing.frameRate(60);
}
processing.setup = setup;
function draw() {
processing.background(220,220,220);
processing.stroke(0);
processing.strokeWeight(2);
processing.fill(60, 90, 100);
processing.rect(30,30,55,55);
processing.noStroke();
processing.rect(90,30,55,55);
processing.line(120, 120, 200, 180);
processing.stroke(0);
processing.strokeWeight(1);
processing.line(150, 30, 200, 30);
}
processing.draw = draw;
});
code.options.cripsLines = true;
this.processingControl = Processing(document.getElementById('nostroke'), code);
/* @pjs crisp=true; */
void setup() {
size(300, 300);
noStroke();
frameRate(60);
}
void draw() {
background(220,220,220);
stroke(0);
strokeWeight(2);
fill(60, 90, 100);
rect(30,30,55,55);
noStroke(); // p.strokeWeight(0) would work;
// expecting p.rect with no border and no visible line
rect(90,30,55,55);
line(120, 120, 200, 180);
stroke(0); // reactivate stroke
strokeWeight(1);
// expecting the horizontal line to be drawn next to the rectangle at using a whole pixel
line(150, 30, 200, 30); // p.line(150, 30.5, 200, 30.5); would work
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment