From c545b58f0367ad4001b3286f1d7b03aa2ade3d7c Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 2 Dec 2016 14:26:24 +0000 Subject: [PATCH] Added another constructor to FlexItem::Margin --- modules/juce_gui_basics/layout/juce_FlexBox.cpp | 7 ++++--- modules/juce_gui_basics/layout/juce_FlexItem.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_FlexBox.cpp b/modules/juce_gui_basics/layout/juce_FlexBox.cpp index 44095f8ffe..ddc19e07de 100644 --- a/modules/juce_gui_basics/layout/juce_FlexBox.cpp +++ b/modules/juce_gui_basics/layout/juce_FlexBox.cpp @@ -806,8 +806,9 @@ FlexItem::FlexItem (float w, float h, FlexBox& fb) noexcept : FlexItem (w, h FlexItem::FlexItem (Component& c) noexcept : associatedComponent (&c) {} FlexItem::FlexItem (FlexBox& fb) noexcept : associatedFlexBox (&fb) {} -FlexItem::Margin::Margin() noexcept : left(), right(), top(), bottom() {} -FlexItem::Margin::Margin (float v) noexcept : left (v), right (v), top (v), bottom (v) {} +FlexItem::Margin::Margin() noexcept : left(), right(), top(), bottom() {} +FlexItem::Margin::Margin (float v) noexcept : left (v), right (v), top (v), bottom (v) {} +FlexItem::Margin::Margin (float l, float r, float t, float b) noexcept : left (l), right (r), top (t), bottom (b) {} //============================================================================== FlexItem FlexItem::withFlex (float newFlexGrow) const noexcept @@ -840,4 +841,4 @@ FlexItem FlexItem::withMaxHeight (float newMaxHeight) const noexcept { auto fi = FlexItem FlexItem::withHeight (float newHeight) const noexcept { auto fi = *this; fi.height = newHeight; return fi; } FlexItem FlexItem::withMargin (Margin m) const noexcept { auto fi = *this; fi.margin = m; return fi; } -FlexItem FlexItem::withOrder (int newOrder) const noexcept { auto fi = *this; fi.order = newOrder; return fi; } \ No newline at end of file +FlexItem FlexItem::withOrder (int newOrder) const noexcept { auto fi = *this; fi.order = newOrder; return fi; } diff --git a/modules/juce_gui_basics/layout/juce_FlexItem.h b/modules/juce_gui_basics/layout/juce_FlexItem.h index 22cd00d551..c3d7830cbe 100644 --- a/modules/juce_gui_basics/layout/juce_FlexItem.h +++ b/modules/juce_gui_basics/layout/juce_FlexItem.h @@ -111,6 +111,7 @@ public: { Margin() noexcept; /**< Creates a margin of size zero. */ Margin (float size) noexcept; /**< Creates a margin with this size on all sides. */ + Margin (float left, float right, float top, float bottom) noexcept; /**< Creates a margin with these sizes. */ float left; /**< Left margin size */ float right; /**< Right margin size */