summaryrefslogtreecommitdiffstats
path: root/libdimension-python
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-09-29 12:43:27 -0400
committerTavian Barnes <tavianator@gmail.com>2011-09-29 12:43:27 -0400
commitb75feadba2021699e09cb611ed00e2f0ff7de3b3 (patch)
tree847afa378fbc28cf6a60b4f4e7d02e1462be5ad5 /libdimension-python
parent6f5735433e9766cbdeab6f151b44ed82e95d2863 (diff)
downloaddimension-b75feadba2021699e09cb611ed00e2f0ff7de3b3.tar.xz
Make the default background for a scene Black.
Fixes segfault on Scene(...).raytrace().
Diffstat (limited to 'libdimension-python')
-rw-r--r--libdimension-python/dimension.pyx6
1 files changed, 2 insertions, 4 deletions
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index c90bf9e..3fff622 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -1390,6 +1390,7 @@ cdef class Scene:
DMNSN_INCREF(self._scene.canvas)
self.outer_width = self._scene.canvas.width
self.outer_height = self._scene.canvas.height
+ self.background = Black
cdef dmnsn_object *o
for obj in objects:
@@ -1452,10 +1453,7 @@ cdef class Scene:
property background:
"""The background pigment of the scene (default: Black)."""
def __get__(self):
- if self._scene.background == NULL:
- return None
- else:
- return _Pigment(self._scene.background)
+ return _Pigment(self._scene.background)
def __set__(self, pigment):
dmnsn_delete_pigment(self._scene.background)
cdef Pigment real_pigment = Pigment(pigment)