Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[feature] Canvas.arc bypass

  • Loading branch information...
commit 86458cb3473a19f9b4c079f2b732bc0eac61d1e6 1 parent de38271
@mattgu74 authored
Showing with 19 additions and 1 deletion.
  1. +7 −0 opabsl/jsbsl/bslCanvas.js
  2. +12 −1 stdlib/core/xhtml/canvas.opa
View
7 opabsl/jsbsl/bslCanvas.js
@@ -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)
{
View
13 stdlib/core/xhtml/canvas.opa
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.