a port of the Processing Visualization Language
Name

/* @pjs crisp */ directive

Examples
/* @pjs crisp="true"; */

void setup()

{

  size(200,200);

  noLoop();

}



void draw()

{

  background(255);

  line(width/4, height/2, width/2, height/4); 

  line(width/2, height/4, 3*width/4, height/2); 

  line(3*width/4, height/2, width/2, 3*height/4);

  line(width/2, 3*height/4, width/4, height/2);

  rect(width/2 - 25, height/2 - 25, 50, 50);

}
Description

Depending on the browser's default settings, canvas elements may or may not apply anti-aliassing to draw instructions. This directive lets you force plain (not anti-aliassed) rendering of the "line", "triangle", and "rect" draw primitives. This results in crisp clean lines, although angled lines may look jagged.

NOTE: the "arc", "ellipse" and "bezier" draw primitives are not effected by this directive.

NOTE: this directive is very expensive, and will result in a significant drop in framerate, and increase in CPU use.

Syntax

        /* @pjs crisp="true"; */
Parameters
crisp "true" (implicitly false for any other value)
Usage Web & Application, Processing.js compatibility
Related @pjs directives

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub