summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorscuri <scuri>2009-06-13 20:40:10 +0000
committerscuri <scuri>2009-06-13 20:40:10 +0000
commita7d154259160d72a5d6430305def60ee271f1f08 (patch)
tree8653d394c9aa21c9891a252646e88657529e04c1 /src/win32
parenta49c3d001aa2a572c9ed53a90566461bbd151b2a (diff)
*** empty log message ***
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/cdwdbuf.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/win32/cdwdbuf.c b/src/win32/cdwdbuf.c
index 035e29e..85af87c 100644
--- a/src/win32/cdwdbuf.c
+++ b/src/win32/cdwdbuf.c
@@ -44,12 +44,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;
@@ -74,15 +81,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 */