Browse Source

Added another constructor to FlexItem::Margin

tags/2021-05-28
jules 9 years ago
parent
commit
c545b58f03
2 changed files with 5 additions and 3 deletions
  1. +4
    -3
      modules/juce_gui_basics/layout/juce_FlexBox.cpp
  2. +1
    -0
      modules/juce_gui_basics/layout/juce_FlexItem.h

+ 4
- 3
modules/juce_gui_basics/layout/juce_FlexBox.cpp View File

@@ -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; }
FlexItem FlexItem::withOrder (int newOrder) const noexcept { auto fi = *this; fi.order = newOrder; return fi; }

+ 1
- 0
modules/juce_gui_basics/layout/juce_FlexItem.h View File

@@ -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 */


Loading…
Cancel
Save