Skip to content

Commit

Permalink
Update view.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaCondemns committed May 12, 2023
1 parent 164f130 commit bf06f8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pygex/gui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def padding_horizontal(self) -> int:
def padding_vertical(self) -> int:
return self._padding_top + self._padding_bottom


@property
def margin_left(self) -> int:
return self._margin_left
Expand Down Expand Up @@ -549,8 +548,7 @@ def process_event(self, e: Event, offsetted_mouse_x: int, offsetted_mouse_y: int
return True

def flip(self):
# ATTENTION: if the View like a ButtonView will be added to the Window view list,
# then this method will call earlier than the render method
"""This method call earlier than the render method"""

if self._visibility == VISIBILITY_GONE or not self.enabled:
self._interaction_state = INTERACTION_STATE_NO_INTERACTION
Expand Down Expand Up @@ -595,6 +593,8 @@ def render_background_surface(self, force_render=False):
self._parent.render_content_surface()

def render(self, surface: SurfaceType, x_off: float | int, y_off: float | int, parent_size: Sequence[int]):
"""This method call later than the flip method"""

if self._visibility != VISIBILITY_VISIBLE:
return

Expand All @@ -614,9 +614,9 @@ def render(self, surface: SurfaceType, x_off: float | int, y_off: float | int, p

bg_width, bg_height = self.get_computed_background_width(), self.get_computed_background_height()

if (
if self._background_drawable is not None and (
self._width == SIZE_MATCH_PARENT and self._background_surface_buffer.get_width() != bg_width
) or (
or
self._height == SIZE_MATCH_PARENT and self._background_surface_buffer.get_height() != bg_height
):
self.render_content_surface()
Expand Down

0 comments on commit bf06f8e

Please sign in to comment.