Skip to content

Commit

Permalink
[feature] Canvas.arc bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgu74 committed Oct 2, 2011
1 parent de38271 commit 86458cb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions opabsl/jsbsl/bslCanvas.js
Expand Up @@ -386,6 +386,13 @@ function bslcanvas_create_pattern(context, image, repeat)
context.arcTo( x1, y1, x2, y2, radius)
}

##register arc: Canvas.context, int, int, int, float, float, bool -> void
##args(context, centerX, centerY, radius, startingAngle, endingAngle, counterclockwise)
{
context.arc(centerX, centerY, radius, startingAngle,
endingAngle, counterclockwise);
}

##register rect: Canvas.context, int, int, int, int -> void
##args(context, x, y, w, h)
{
Expand Down
13 changes: 12 additions & 1 deletion stdlib/core/xhtml/canvas.opa
Expand Up @@ -394,7 +394,18 @@ Canvas = {{
arc_to(context : Canvas.context, x1 : int, y1 : int, x2 : int, y2 : int, r : int) : void =
%% BslCanvas.arc_to %%(context,x1,y1,x2,y2,r)

//todo arc
/**
* arc
* @param context : Canvas.context
* @param centerX : int
* @param centerY : int
* @param radius : int
* @param startingAngle : float
* @param endinAngle : float
* @param counterclockwise : bool
*/
arc(context : Canvas.context, centerX : int, centerY : int, radius : int, startingAngle : float, endingAngle : float, counterclockwise : bool) : void =
%% BslCanvas.arc %%(context, centerX, centerY, radius, startingAngle, endingAngle, counterclockwise)

rect(context : Canvas.context, x : int, y : int, w : int, h : int) : void =
%% BslCanvas.rect %%(context,x,y,w,h)
Expand Down

0 comments on commit 86458cb

Please sign in to comment.