tuikit/core/container.py
changeset 94 e50dae408fe9
parent 93 c1e79acb9fcb
child 97 0c2e0c09ba5c
--- a/tuikit/core/container.py	Thu Mar 27 08:03:51 2014 +0100
+++ b/tuikit/core/container.py	Fri Mar 28 10:44:29 2014 +0100
@@ -28,13 +28,14 @@
         Widget.resize(self, w, h)
         self.layout.resize()
 
-    def draw(self, buffer, x=0, y=0):
+    def draw(self, buffer):
         """Draw child widgets."""
+        Widget.draw(self, buffer)
         for child in self.children:
-            cx = x + child.x
-            cy = y + child.y
-            with buffer.clip(cx, cy, child.width, child.height):
-                child.draw(buffer, cx, cy)
+            with buffer.moved_origin(child.x, child.y):
+                with buffer.clip(buffer.origin.x, buffer.origin.y,
+                                 child.width, child.height):
+                    child.draw(buffer)
 
     def set_theme(self, theme):
         Widget.set_theme(self, theme)