[dia] [pydia] Fix all colors being black



commit 85c3e725e0ee8df2dc1501927b64a2a6c053aec5
Author: Hans Breuer <hans breuer org>
Date:   Fri Jan 14 22:44:41 2011 +0100

    [pydia] Fix all colors being black
    
    Dia's Color struct consists of three float, no double. The switch to direct struct access through Python for documentation purpose broke the access.
    I don't quite understand why it did not produce a crash.

 plug-ins/python/pydia-color.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/python/pydia-color.c b/plug-ins/python/pydia-color.c
index 5ac746c..6fa2ed2 100644
--- a/plug-ins/python/pydia-color.c
+++ b/plug-ins/python/pydia-color.c
@@ -84,11 +84,11 @@ PyDiaColor_Str(PyDiaColor *self)
 }
 
 static PyMemberDef PyDiaColor_Members[] = {
-    { "red", T_DOUBLE, offsetof(PyDiaColor, color.red), 0,
+    { "red", T_FLOAT, offsetof(PyDiaColor, color.red), 0,
       "double: red color component [0 .. 1.0]" },
-    { "green", T_DOUBLE, offsetof(PyDiaColor, color.green), 0,
+    { "green", T_FLOAT, offsetof(PyDiaColor, color.green), 0,
       "double: green color component [0 .. 1.0]" },
-    { "blue", T_DOUBLE, offsetof(PyDiaColor, color.blue), 0,
+    { "blue", T_FLOAT, offsetof(PyDiaColor, color.blue), 0,
       "double: blue color component [0 .. 1.0]" },
     { NULL }
 };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]