Skip to content

Commit

Permalink
Ajout de gc_check_open oublies
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1345 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
xavierleroy committed Mar 8, 1997
1 parent 9db6847 commit 537ecc5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions otherlibs/graph/draw.c
Expand Up @@ -19,6 +19,7 @@ value gr_plot(vx, vy)
{
int x = Int_val(vx);
int y = Int_val(vy);
gr_check_open();
XDrawPoint(grdisplay, grwindow.win, grwindow.gc, x, Wcvt(y));
XDrawPoint(grdisplay, grbstore.win, grbstore.gc, x, Bcvt(y));
XFlush(grdisplay);
Expand Down Expand Up @@ -47,6 +48,7 @@ value gr_lineto(vx, vy)
{
int x = Int_val(vx);
int y = Int_val(vy);
gr_check_open();
XDrawLine(grdisplay, grwindow.win, grwindow.gc,
grx, Wcvt(gry), x, Wcvt(y));
XDrawLine(grdisplay, grbstore.win, grbstore.gc,
Expand All @@ -67,6 +69,7 @@ value gr_draw_arc_nat(vx, vy, vrx, vry, va1, va2)
int a1 = Int_val(va1);
int a2 = Int_val(va2);

gr_check_open();
XDrawArc(grdisplay, grwindow.win, grwindow.gc,
x - rx, Wcvt(y) - ry, rx * 2, ry * 2, a1 * 64, (a2 - a1) * 64);
XDrawArc(grdisplay, grbstore.win, grbstore.gc,
Expand All @@ -86,6 +89,7 @@ value gr_set_line_width(vwidth)
value vwidth;
{
int width = Int_val(vwidth);
gr_check_open();
XSetLineAttributes(grdisplay, grwindow.gc,
width, LineSolid, CapRound, JoinRound);
XSetLineAttributes(grdisplay, grbstore.gc,
Expand Down
3 changes: 3 additions & 0 deletions otherlibs/graph/fill.c
Expand Up @@ -22,6 +22,7 @@ value gr_fill_rect(vx, vy, vw, vh)
int w = Int_val(vw);
int h = Int_val(vh);

gr_check_open();
XFillRectangle(grdisplay, grwindow.win, grwindow.gc,
x, Wcvt(y) - h + 1, w, h);
XFillRectangle(grdisplay, grbstore.win, grbstore.gc,
Expand All @@ -36,6 +37,7 @@ value gr_fill_poly(array)
XPoint * points;
int npoints, i;

gr_check_open();
npoints = Wosize_val(array);
points = (XPoint *) stat_alloc(npoints * sizeof(XPoint));
for (i = 0; i < npoints; i++) {
Expand Down Expand Up @@ -64,6 +66,7 @@ value gr_fill_arc_nat(vx, vy, vrx, vry, va1, va2)
int a1 = Int_val(va1);
int a2 = Int_val(va2);

gr_check_open();
XFillArc(grdisplay, grwindow.win, grwindow.gc,
x - rx, Wcvt(y) - ry, rx * 2, ry * 2, a1 * 64, (a2 - a1) * 64);
XFillArc(grdisplay, grbstore.win, grbstore.gc,
Expand Down
1 change: 1 addition & 0 deletions otherlibs/graph/point_col.c
Expand Up @@ -21,6 +21,7 @@ value gr_point_color(vx, vy)
XImage * im;
int rgb;

gr_check_open();
im = XGetImage(grdisplay, grbstore.win, x, Bcvt(y), 1, 1, (-1), ZPixmap);
rgb = gr_rgb_pixel(XGetPixel(im, 0, 0));
XDestroyImage(im);
Expand Down

0 comments on commit 537ecc5

Please sign in to comment.