From 4ce2690bd28eb45d21097c18c749990b98b0387f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Sep 2021 08:39:27 +0530 Subject: [PATCH] DRYer --- kittens/tui/images.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kittens/tui/images.py b/kittens/tui/images.py index ed9b2119a..bdf78ec23 100644 --- a/kittens/tui/images.py +++ b/kittens/tui/images.py @@ -72,12 +72,10 @@ class Frame: self.mode = 'rgba' if q in ('blend', 'true') else 'rgb' self.needs_blend = q == 'blend' self.dispose = getattr(Dispose, identify_data['dispose'].lower()) - if identify_data.get('orientation') in ('5', '6', '7', '8'): + self.dimensions_swapped = identify_data.get('orientation') in ('5', '6', '7', '8') + if self.dimensions_swapped: self.canvas_width, self.canvas_height = self.canvas_height, self.canvas_width self.width, self.height = self.height, self.width - self.dimensions_swapped = True - else: - self.dimensions_swapped = False def __repr__(self) -> str: canvas = f'{self.canvas_width}x{self.canvas_height}:{self.canvas_x}+{self.canvas_y}'