Remove unused parameter in NEED_BAR() macro

This commit is contained in:
David Capello 2023-02-02 11:54:13 -03:00
parent 28749edf10
commit 67bb8f49ea

View File

@ -1,5 +1,6 @@
// Aseprite UI Library // Aseprite UI Library
// Copyright (C) 2001-2013, 2015 David Capello // Copyright (C) 2023 Igara Studio S.A.
// Copyright (C) 2001-2015 David Capello
// //
// This file is released under the terms of the MIT license. // This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information. // Read LICENSE.txt for more information.
@ -18,7 +19,7 @@ void setup_scrollbars(const gfx::Size& scrollableSize,
ScrollBar& hbar, ScrollBar& hbar,
ScrollBar& vbar) ScrollBar& vbar)
{ {
#define NEED_BAR(w, h, width) \ #define NEED_BAR(w, h) \
((scrollableSize.w > viewportArea.w) && \ ((scrollableSize.w > viewportArea.w) && \
(vbar.getBarWidth() < fullViewportArea.w) && \ (vbar.getBarWidth() < fullViewportArea.w) && \
(hbar.getBarWidth() < fullViewportArea.h)) (hbar.getBarWidth() < fullViewportArea.h))
@ -31,13 +32,13 @@ void setup_scrollbars(const gfx::Size& scrollableSize,
if (hbar.parent()) parent.removeChild(&hbar); if (hbar.parent()) parent.removeChild(&hbar);
if (vbar.parent()) parent.removeChild(&vbar); if (vbar.parent()) parent.removeChild(&vbar);
if (NEED_BAR(w, h, width)) { if (NEED_BAR(w, h)) {
viewportArea.h -= hbar.getBarWidth(); viewportArea.h -= hbar.getBarWidth();
parent.addChild(&hbar); parent.addChild(&hbar);
if (NEED_BAR(h, w, height)) { if (NEED_BAR(h, w)) {
viewportArea.w -= vbar.getBarWidth(); viewportArea.w -= vbar.getBarWidth();
if (NEED_BAR(w, h, width)) if (NEED_BAR(w, h))
parent.addChild(&vbar); parent.addChild(&vbar);
else { else {
viewportArea.w += vbar.getBarWidth(); viewportArea.w += vbar.getBarWidth();
@ -46,13 +47,13 @@ void setup_scrollbars(const gfx::Size& scrollableSize,
} }
} }
} }
else if (NEED_BAR(h, w, height)) { else if (NEED_BAR(h, w)) {
viewportArea.w -= vbar.getBarWidth(); viewportArea.w -= vbar.getBarWidth();
parent.addChild(&vbar); parent.addChild(&vbar);
if (NEED_BAR(w, h, width)) { if (NEED_BAR(w, h)) {
viewportArea.h -= hbar.getBarWidth(); viewportArea.h -= hbar.getBarWidth();
if (NEED_BAR(h, w, height)) if (NEED_BAR(h, w))
parent.addChild(&hbar); parent.addChild(&hbar);
else { else {
viewportArea.w += vbar.getBarWidth(); viewportArea.w += vbar.getBarWidth();