summaryrefslogtreecommitdiffstats
path: root/otherlibs/graph/graphics.ml
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/graph/graphics.ml')
-rw-r--r--otherlibs/graph/graphics.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/otherlibs/graph/graphics.ml b/otherlibs/graph/graphics.ml
index 56b9755a3..3af9466ef 100644
--- a/otherlibs/graph/graphics.ml
+++ b/otherlibs/graph/graphics.ml
@@ -80,8 +80,13 @@ and foreground = black
external plot : int -> int -> unit = "gr_plot"
external point_color : int -> int -> color = "gr_point_color"
external moveto : int -> int -> unit = "gr_moveto"
-external current_point : unit -> int * int = "gr_current_point"
+external current_x : unit -> int = "gr_current_x"
+external current_y : unit -> int = "gr_current_y"
+let current_point () = current_x (), current_y ()
external lineto : int -> int -> unit = "gr_lineto"
+let rlineto x y = lineto (current_x () + x) (current_y () + y)
+let rmoveto x y = moveto (current_x () + x) (current_y () + y)
+external draw_rect : int -> int -> int -> int -> unit = "gr_draw_rect"
external draw_arc : int -> int -> int -> int -> int -> int -> unit
= "gr_draw_arc" "gr_draw_arc_nat"
let draw_ellipse x y rx ry = draw_arc x y rx ry 0 360