Update the location and the size of the bbox. This method should be used when the position and size of the bbox needs to be updated before actually drawing the bbox.
(self, renderer)
| 657 | return self._bbox_patch |
| 658 | |
| 659 | def update_bbox_position_size(self, renderer): |
| 660 | """ |
| 661 | Update the location and the size of the bbox. |
| 662 | |
| 663 | This method should be used when the position and size of the bbox needs |
| 664 | to be updated before actually drawing the bbox. |
| 665 | """ |
| 666 | if self._bbox_patch: |
| 667 | # don't use self.get_unitless_position here, which refers to text |
| 668 | # position in Text: |
| 669 | posx = float(self.convert_xunits(self._x)) |
| 670 | posy = float(self.convert_yunits(self._y)) |
| 671 | posx, posy = self.get_transform().transform((posx, posy)) |
| 672 | |
| 673 | _, _, ((x_box, y_box), (w_box, h_box)) = self._get_layout(renderer) |
| 674 | self._bbox_patch.set_bounds(0., 0., w_box, h_box) |
| 675 | self._bbox_patch.set_transform( |
| 676 | Affine2D() |
| 677 | .rotate_deg(self.get_rotation()) |
| 678 | .translate(posx + x_box, posy + y_box)) |
| 679 | fontsize_in_pixel = renderer.points_to_pixels(self.get_size()) |
| 680 | self._bbox_patch.set_mutation_scale(fontsize_in_pixel) |
| 681 | |
| 682 | def _update_clip_properties(self): |
| 683 | if self._bbox_patch: |
no test coverage detected