def _realign(self):
if self.__assigned_rect is None:<EOL><INDENT>return<EOL><DEDENT>max_rect = self.__assigned_rect.copy()<EOL>max_rect.left += self.left_padding<EOL>max_rect.bottom += self.bottom_padding<EOL>max_rect.width -= self.total_horz_padding<EOL>max_rect.height -= self.total_vert_padding<EOL>aligned_rect = Rect.from_size(self.__min_width, self.__min_height)<EOL>drawing.align(self.__alignment, aligned_rect, max_rect)<EOL>aligned_rect.round()<EOL>if self.__rect is None or self.__rect != aligned_rect:<EOL><INDENT>self.__rect = aligned_rect<EOL>self.__padded_rect = aligned_rect.copy()<EOL>self.__padded_rect.left -= self.left_padding<EOL>self.__padded_rect.bottom -= self.bottom_padding<EOL>self.__padded_rect.width += self.total_horz_padding<EOL>self.__padded_rect.height += self.total_vert_padding<EOL>self.do_resize()<EOL><DEDENT>self._draw()<EOL>if self.__num_children > <NUM_LIT:0>:<EOL><INDENT>self.do_resize_children()<EOL><DEDENT>
Update the amount of space available for the widget's content, given 
the amount of space assigned to it by its parent.

Starting from the amount of space assigned to this widget by its parent, 
this means subtracting the padding, performing the proper alignment, 
and rounding to the nearest integer pixel to prevent seams from 
appearing.  The final result is stored in ``self.__rect``.  

Three callbacks are invoked to allow the widget to react to this 
change: `do_resize()`, `do_draw()`, and `do_resize_children()`.  The 
last initiates a recursive descent down the widget hierarchy updating 
the sizes of the widget's children and all of their children, which is 
a critical part of the repacking process.

This method should not be called outside of a repack, because it 
assumes that the claims have already been updated.