Fix API for hippo-canvas 0.2
This commit is contained in:
@@ -47,7 +47,7 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
x = cx - (width / 2)
|
||||
y = cy - (height / 2)
|
||||
|
||||
self.move(self._root, int(x), int(y))
|
||||
self.set_position(self._root, int(x), int(y))
|
||||
|
||||
def _get_n_children(self):
|
||||
return len(self.get_children()) - 1
|
||||
@@ -65,7 +65,7 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
x = cx + math.cos(angle) * r - (width / 2)
|
||||
y = cy + math.sin(angle) * r - (height / 2)
|
||||
|
||||
self.move(child, int(x), int(y))
|
||||
self.set_position(child, int(x), int(y))
|
||||
|
||||
def do_get_width_request(self):
|
||||
hippo.CanvasBox.do_get_width_request(self)
|
||||
@@ -84,7 +84,7 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
hippo.CanvasBox.do_get_height_request(self, width)
|
||||
return width
|
||||
|
||||
def do_allocate(self, width, height):
|
||||
def do_allocate(self, width, height, origin_changed):
|
||||
hippo.CanvasBox.do_allocate(self, width, height)
|
||||
|
||||
self._layout_root()
|
||||
|
||||
@@ -109,10 +109,10 @@ class SpreadBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
|
||||
[new_x, new_y] = self._clamp_position(icon1, new_x, new_y)
|
||||
|
||||
self.move(icon1, new_x, new_y)
|
||||
self.set_position(icon1, new_x, new_y)
|
||||
|
||||
def do_allocate(self, width, height):
|
||||
hippo.CanvasBox.do_allocate(self, width, height)
|
||||
def do_allocate(self, width, height, origin_changed):
|
||||
hippo.CanvasBox.do_allocate(self, width, height, origin_changed)
|
||||
|
||||
for item in self._items_to_position:
|
||||
[item_w, item_h] = item.get_request()
|
||||
@@ -121,7 +121,7 @@ class SpreadBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
y = int(random.random() * height - item_h)
|
||||
|
||||
[x, y] = self._clamp_position(item, x, y)
|
||||
self.move(item, x, y)
|
||||
self.set_position(item, x, y)
|
||||
|
||||
self._items_to_position = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user