Difference between revisions of "Porting pushStyle(), popStyle(), and boolean() to Processing.js"

From CDOT Wiki
Jump to: navigation, search
m
Line 5: Line 5:
 
[http://processingjs.org/ Processing.js] remains incomplete as a port of [http://processing.org/ Processing]. Among the features still to be implemented are the functions [http://processing.org/reference/pushStyle_.html ''pushStyle()''], [http://processing.org/reference/popStyle_.html ''popStyle()''], and [http://processing.org/reference/boolean_.html ''boolean()'']. The first two functions automatically save style information for later retrieval and reuse. The last "converts" arguments into a boolean value.
 
[http://processingjs.org/ Processing.js] remains incomplete as a port of [http://processing.org/ Processing]. Among the features still to be implemented are the functions [http://processing.org/reference/pushStyle_.html ''pushStyle()''], [http://processing.org/reference/popStyle_.html ''popStyle()''], and [http://processing.org/reference/boolean_.html ''boolean()'']. The first two functions automatically save style information for later retrieval and reuse. The last "converts" arguments into a boolean value.
  
This project seeks to implement those three functions. The repository may be found [http://github.com/mlam19/processing-js here].
+
== Resources ==
 +
*[http://github.com/mlam19/processing-js GitHub branch]
 +
*[http://processing-js.lighthouseapp.com/projects/41284-processingjs/overview Lighthouse issue tracking]
 +
*[https://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb Processing for the Web @ Mozilla]
  
 
== Project Leader(s) ==
 
== Project Leader(s) ==
Line 36: Line 39:
 
|Test cases for  ''pushStyle()'' and ''popStyle()''
 
|Test cases for  ''pushStyle()'' and ''popStyle()''
 
|In progress
 
|In progress
|[[User:mlam19|Matthew Lam]] (but you can help too!)
+
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/pushPopTest1.html Test page (wip)]
+
|[http://matrix.senecac.on.ca/~mlam19/processingjs/pushPopTest1.html Test page]
 
|-
 
|-
 
|Test cases for  ''boolean()''
 
|Test cases for  ''boolean()''
 
|In progress
 
|In progress
|[[User:mlam19|Matthew Lam]] (but you can help too!)
+
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/booleanTest1.html Test page (wip)]
+
|[http://matrix.senecac.on.ca/~mlam19/processingjs/booleanTest1.html Test page]
 
|}
 
|}
  
Line 51: Line 54:
 
!Notes
 
!Notes
 
!Resources
 
!Resources
 +
|-
 +
|0.2
 +
|Bug fixes for ''pushStyle()'', ''popStyle()'', and ''boolean()''. Functions now functional.
 +
|[http://matrix.senecac.on.ca/~mlam19/processingjs/files/mlam19_procjs_0.2.diff.tar.gz Patch]
 
|-
 
|-
 
|0.1
 
|0.1
Line 72: Line 79:
 
|-
 
|-
 
|Sept. 27, 2009
 
|Sept. 27, 2009
|BThe [http://wobblyretroaction.blogspot.com/2009/09/processingjs-plan-to-push-and-pop.html initial project proposal] has been posted. [http://github.com/mlam19/processing-js Repository] at github created.
+
|The [http://wobblyretroaction.blogspot.com/2009/09/processingjs-plan-to-push-and-pop.html initial project proposal] has been posted. [http://github.com/mlam19/processing-js Repository] at github created.
 
|}
 
|}

Revision as of 20:41, 19 November 2009

Project Name

Porting pushStyle(), popStyle(), and boolean() to Processing.js

Project Description

Processing.js remains incomplete as a port of Processing. Among the features still to be implemented are the functions pushStyle(), popStyle(), and boolean(). The first two functions automatically save style information for later retrieval and reuse. The last "converts" arguments into a boolean value.

Resources

Project Leader(s)

Project Contributor(s)

Project Details

pushStyle() and popStyle()

The number of states saved is tracked by pushedStates.

pushStyle() calls curContext.save() and increments pushedStates by one.

popStyle() checks if there are any saved states via pushedStates. If there are none an error notice to the console or as a JavaScript alert, in an attempt to provide similar behaviour to Processing's implementation. If there are saved states, the function calls curContext.restore() and decrements pushedStates by one.

Related Mozilla bugs

  • #451165 - CanvasRenderingContext2D.fillStyle and strokeStyle accept invalid colours
    • pushStyle() and popStyle() use CanvasRenderingContext2D.save() and restore(). These functions save fillStyle and strokeStyle.

boolean()

Things to do

Description Status Assigned to Link
Test cases for pushStyle() and popStyle() In progress Matthew Lam Test page
Test cases for boolean() In progress Matthew Lam Test page

Releases

Version Notes Resources
0.2 Bug fixes for pushStyle(), popStyle(), and boolean(). Functions now functional. Patch
0.1 Basic functionality for pushStyle() and popStyle(). Totally untested code for boolean(). Patch

Project News

Date Notes
Oct. 19, 2009 Release 0.1 announcement.
Oct. 12, 2009 Project expanded to include boolean().
Sept. 28, 2009 Basic improvements allow the rudimentary Processing example to function in Processing.js.
Sept. 27, 2009 The initial project proposal has been posted. Repository at github created.