Simple GUI Library
shape.cpp
Go to the documentation of this file.
1/**
2 * @author Nikita Mochalov (github.com/tralf-strues)
3 * @file shape.cpp
4 * @date 2021-11-08
5 *
6 * @copyright Copyright (c) 2021
7 */
8
10
11namespace Sgl
12{
13 Shape::Shape(Sml::Color fillColor) : m_FillColor(fillColor) {}
14 Shape::Shape(const Background* background) : m_Background(background) {}
15
16 void Shape::layout() { updateShadow(); }
17 bool Shape::isResizable() const { return false; }
18
19 // const std::vector<const Fill*>& Shape::getFills() const { return m_Fills; }
20 // void Shape::addFill(const Fill* fill) { assert(fill); m_Fills.push_back(fill); }
21
22 // void Shape::setFill(const Fill* fill)
23 // {
24 // assert(fill);
25 // m_Fills.clear();
26 // m_Fills.push_back(fill);
27 // }
28
29 Sml::Color Shape::getFillColor() const { return m_FillColor; }
30 void Shape::setFillColor(Sml::Color color) { m_FillColor = color; }
31
32 const Background* Shape::getBackground() const { return m_Background; }
33 void Shape::setBackground(const Background* background) { m_Background = background; }
34
35 const Border* Shape::getBorder() const { return m_Border; }
36 void Shape::setBorder(const Border* border) { m_Border = border; }
37
38 int32_t Shape::computeMinWidth(int32_t height) const { return getLayoutWidth(); }
39 int32_t Shape::computeMinHeight(int32_t width) const { return getLayoutHeight(); }
40
41 int32_t Shape::computeMaxWidth(int32_t height) const { return getLayoutWidth(); }
42 int32_t Shape::computeMaxHeight(int32_t width) const { return getLayoutHeight(); }
43}