From 37731d2a9578b997c7ef9a03ad3f12119095ef35 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 3 Aug 2023 18:32:58 +0200 Subject: [PATCH] libui: Remove redundant statement --- libui/src/Canvas.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libui/src/Canvas.cpp b/libui/src/Canvas.cpp index 8ea75987..a0c1c647 100644 --- a/libui/src/Canvas.cpp +++ b/libui/src/Canvas.cpp @@ -9,16 +9,8 @@ namespace ui Canvas Canvas::subcanvas(Rect rect) { - if (rect.pos.x < 0) - { - rect.pos.x = 0; - rect.width = rect.width + rect.pos.x; - } - if (rect.pos.y < 0) - { - rect.pos.y = 0; - rect.height = rect.height + rect.pos.y; - } + if (rect.pos.x < 0) rect.pos.x = 0; + if (rect.pos.y < 0) rect.pos.y = 0; if (rect.pos.x + rect.width > width) rect.width = width - rect.pos.x; if (rect.pos.y + rect.height > height) rect.height = height - rect.pos.y;