From d01028cc99caae6ec4b80eed7456f17ddca80910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 30 Dec 2009 16:33:46 +0000 Subject: [PATCH] [GB.DRAW] * BUG: Fix the Brush.Matrix property management. git-svn-id: svn://localhost/gambas/trunk@2560 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- examples/examples/Drawing/Painting/.src/FMain.class | 2 +- gb.qt4/src/cpaint_impl.cpp | 2 +- main/lib/draw/cpaint.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/examples/Drawing/Painting/.src/FMain.class b/examples/examples/Drawing/Painting/.src/FMain.class index 0bcf81570..12eecf8c6 100644 --- a/examples/examples/Drawing/Painting/.src/FMain.class +++ b/examples/examples/Drawing/Painting/.src/FMain.class @@ -297,7 +297,7 @@ Public Sub Example12() Paint.Scale(1 / Sqr(2), 1 / Sqr(2)) Paint.Translate(-128, -128) hBrush = Paint.Image(himg, 0, 0) - hBrush.Matrix = hBrush.Matrix.Scale(himg.w / 256.0 * 5.0, hImg.w / 256.0 * 5.0) + hBrush.Matrix = hBrush.Matrix.Scale(1 / (himg.w / 256.0 * 5.0), 1 / (hImg.w / 256.0 * 5.0)) Paint.Brush = hBrush Paint.Rectangle(0, 0, 256, 256) Paint.Fill diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index bdd88a213..fa69bf66f 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -651,7 +651,7 @@ static void BrushImage(GB_BRUSH *brush, GB_IMAGE image) QImage *img = CIMAGE_get((CIMAGE *)image); QBrush *br = new QBrush(*img); - *brush = br; + *brush = (GB_BRUSH)br; } static void BrushLinearGradient(GB_BRUSH *brush, float x0, float y0, float x1, float y1, int nstop, double *positions, GB_COLOR *colors, int extend) diff --git a/main/lib/draw/cpaint.c b/main/lib/draw/cpaint.c index 1c76f043e..1664064a3 100644 --- a/main/lib/draw/cpaint.c +++ b/main/lib/draw/cpaint.c @@ -266,16 +266,16 @@ BEGIN_PROPERTY(PaintBrush_Matrix) if (READ_PROPERTY) { BPAINT->Transform.Create(&transform); - BPAINT->Brush.Matrix(BTHIS, FALSE, transform); + BPAINT->Brush.Matrix(BTHIS->brush, FALSE, transform); GB.ReturnObject(create_matrix(BPAINT, transform)); } else { matrix = (PAINT_MATRIX *)VPROP(GB_OBJECT); if (!matrix) - BPAINT->Brush.Matrix(BTHIS, TRUE, NULL); + BPAINT->Brush.Matrix(BTHIS->brush, TRUE, NULL); else - BPAINT->Brush.Matrix(BTHIS, TRUE, matrix->transform); + BPAINT->Brush.Matrix(BTHIS->brush, TRUE, matrix->transform); } END_PROPERTY