diff options
author | scuri <scuri> | 2009-06-13 20:40:10 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-06-13 20:40:10 +0000 |
commit | a7d154259160d72a5d6430305def60ee271f1f08 (patch) | |
tree | 8653d394c9aa21c9891a252646e88657529e04c1 /src/x11 | |
parent | a49c3d001aa2a572c9ed53a90566461bbd151b2a (diff) |
*** empty log message ***
Diffstat (limited to 'src/x11')
-rw-r--r-- | src/x11/cdxdbuf.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/x11/cdxdbuf.c b/src/x11/cdxdbuf.c index 1c92da5..835687c 100644 --- a/src/x11/cdxdbuf.c +++ b/src/x11/cdxdbuf.c @@ -41,12 +41,19 @@ static void cdflush(cdCtxCanvas* ctxcanvas) static void cdcreatecanvas(cdCanvas* canvas, cdCanvas* canvas_dbuffer) { + int w, h; cdCtxCanvas* ctxcanvas; cdImage* image_dbuffer; cdCtxImage* ctximage; + cdCanvasActivate(canvas_dbuffer); + w = canvas_dbuffer->w; + h = canvas_dbuffer->h; + if (w==0) w=1; + if (h==0) h=1; + /* this is done in the canvas_dbuffer context */ - image_dbuffer = cdCanvasCreateImage(canvas_dbuffer, canvas_dbuffer->w, canvas_dbuffer->h); + image_dbuffer = cdCanvasCreateImage(canvas_dbuffer, w, h); if (!image_dbuffer) return; @@ -63,15 +70,20 @@ static void cdcreatecanvas(cdCanvas* canvas, cdCanvas* canvas_dbuffer) static int cdactivate(cdCtxCanvas* ctxcanvas) { + int w, h; cdCanvas* canvas_dbuffer = ctxcanvas->canvas_dbuffer; /* this is done in the canvas_dbuffer context */ /* this will update canvas size */ cdCanvasActivate(canvas_dbuffer); + w = canvas_dbuffer->w; + h = canvas_dbuffer->h; + if (w==0) w=1; + if (h==0) h=1; /* check if the size changed */ - if (canvas_dbuffer->w != ctxcanvas->image_dbuffer->w || - canvas_dbuffer->h != ctxcanvas->image_dbuffer->h) + if (w != ctxcanvas->image_dbuffer->w || + h != ctxcanvas->image_dbuffer->h) { cdCanvas* canvas = ctxcanvas->canvas; /* save the current, if the rebuild fail */ |