| 578 | | else: |
|---|
| 579 | | self.queue_draw_item(i) |
|---|
| 580 | | |
|---|
| 581 | | self.update_matrix(i) |
|---|
| 582 | | i2v = self.get_matrix_i2v(i).transform_point |
|---|
| 583 | | x0, y0 = i2v(bounds.x, bounds.y) |
|---|
| 584 | | x1, y1 = i2v(bounds.x1, bounds.y1) |
|---|
| 585 | | vbounds = Rectangle(x0, y0, x1=x1, y1=y1) |
|---|
| 586 | | self._qtree.add(i, vbounds, bounds) |
|---|
| 587 | | |
|---|
| 588 | | # TODO: find an elegant way to update parent bb's. |
|---|
| 589 | | #parent = self.canvas.get_parent(i) |
|---|
| 590 | | #if parent: |
|---|
| 591 | | # try: |
|---|
| 592 | | # parent_bounds = self._qtree.get_bounds(parent) |
|---|
| 593 | | # except KeyError: |
|---|
| 594 | | # pass # No bounds, do nothing |
|---|
| 595 | | # else: |
|---|
| 596 | | # if not vbounds in parent_bounds: |
|---|
| 597 | | # self.set_item_bounding_box(parent, vbounds + parent_bounds) |
|---|
| 598 | | self.queue_draw_item(i) |
|---|
| | 576 | continue |
|---|
| | 577 | |
|---|
| | 578 | bounds = self._qtree.get_data(i) |
|---|
| | 579 | self.queue_draw_item(i) |
|---|
| | 580 | |
|---|
| | 581 | self.update_matrix(i) |
|---|
| | 582 | i2v = self.get_matrix_i2v(i).transform_point |
|---|
| | 583 | x0, y0 = i2v(bounds.x, bounds.y) |
|---|
| | 584 | x1, y1 = i2v(bounds.x1, bounds.y1) |
|---|
| | 585 | vbounds = Rectangle(x0, y0, x1=x1, y1=y1) |
|---|
| | 586 | self._qtree.add(i, vbounds, bounds) |
|---|
| | 587 | |
|---|
| | 588 | # TODO: find an elegant way to update parent bb's. |
|---|
| | 589 | #parent = self.canvas.get_parent(i) |
|---|
| | 590 | #if parent: |
|---|
| | 591 | # try: |
|---|
| | 592 | # parent_bounds = self._qtree.get_bounds(parent) |
|---|
| | 593 | # except KeyError: |
|---|
| | 594 | # pass # No bounds, do nothing |
|---|
| | 595 | # else: |
|---|
| | 596 | # if not vbounds in parent_bounds: |
|---|
| | 597 | # self.set_item_bounding_box(parent, vbounds + parent_bounds) |
|---|
| | 598 | self.queue_draw_item(i) |
|---|