aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/left_panel/board/Theme.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-01-01 20:21:23 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-01-01 20:21:23 +0100
commit29d5850b2f44ad520fc89324a110a721ac08841b (patch)
tree5a1127982c5040234c853326bb656358b5b971ca /src/game_tab/left_panel/board/Theme.cpp
parentdcf6c01e54c5306fac464706cff81e75ee8f05bf (diff)
Improve board canvas
Diffstat (limited to 'src/game_tab/left_panel/board/Theme.cpp')
-rw-r--r--src/game_tab/left_panel/board/Theme.cpp5
1 files changed, 4 insertions, 1 deletions
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) {