From 29d5850b2f44ad520fc89324a110a721ac08841b Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 1 Jan 2023 20:21:23 +0100 Subject: Improve board canvas --- src/game_tab/left_panel/board/Theme.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/game_tab/left_panel/board/Theme.cpp') diff --git a/src/game_tab/left_panel/board/Theme.cpp b/src/game_tab/left_panel/board/Theme.cpp index 6ecbafc..0c05fa1 100644 --- a/src/game_tab/left_panel/board/Theme.cpp +++ b/src/game_tab/left_panel/board/Theme.cpp @@ -130,10 +130,13 @@ void Theme::ResizeSquares(std::uint32_t width) { skin_scaled['3']->SetMask(RoundedMask(width, 3)); } -void Theme::Zoom(int amount) { +bool Theme::Zoom(int amount) { double width = skin_scaled['s']->GetWidth() + amount; + if(width<=20) + return false; ResizeSquares(std::max(width, 1.0)); ResizePieces(std::max(width * PIECE_SIZE_FACTOR, 1.0)); + return true; } void Theme::SetSquareRadius(std::uint8_t radius) { -- cgit v1.2.3