Skip to content
Snippets Groups Projects
Commit 28a7e4ec authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Adjusted layout preview window size

parent f6adebf2
No related branches found
No related tags found
1 merge request!110V1.2.0 changes
Pipeline #60270 passed
......@@ -1248,7 +1248,7 @@ class PyGameGUI:
layout_path = self.layout_file_paths_dict[layout_name]
max_size = layout_display_height * 0.9
factor = 2
factor = 6
layout_surface = layout_thumbnail(layout_path, vis, max_size * factor, item_lookup)
layout_image = pygame_gui.elements.UIImage(
relative_rect=pygame.transform.scale_by(layout_surface, 1 / factor).get_rect(),
......@@ -2076,7 +2076,13 @@ class PyGameGUI:
"translations.selected_layout", text_kwargs={"layout": self.selected_layout.replace(".layout", "")}
)
if self.layout_surfaces:
new_surf = pygame.transform.scale_by(self.layout_surfaces[self.selected_layout], 0.8)
print(self.selected_layout_label.rect)
# between label and start button
max_target_height = ((self.window_height // 2) - self.buttons_height - (self.buttons_height // 2)) * 0.8
new_surf = pygame.transform.scale_by(self.layout_surfaces[self.selected_layout],
max_target_height / self.layout_surfaces[
self.selected_layout].get_height())
self.preview_layout_image.set_dimensions(new_surf.get_size())
self.preview_layout_image.set_image(new_surf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment