diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-12 19:13:34 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-12 19:13:34 +0100 |
| commit | a359219e33fdf3afb5ddfbb084563054a947b106 (patch) | |
| tree | 91dab9c21321f73152993183cd6e8cf4a04017f8 /src/components/Margin.cpp | |
Create project
Diffstat (limited to 'src/components/Margin.cpp')
| -rw-r--r-- | src/components/Margin.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/components/Margin.cpp b/src/components/Margin.cpp new file mode 100644 index 0000000..077cce5 --- /dev/null +++ b/src/components/Margin.cpp @@ -0,0 +1,30 @@ +#include "Margin.hpp" + +namespace cgeditor { + +Margin::Margin(Status *s) : Component(s) {} + +void Margin::Refresh() { + elements.clear(); + Element e; + e.x = 0; + e.y = 0; + e.height = status->CanvasHeight - status->ScrollbarWidth; + e.ShouldApplyScroll = true; + e.IgnoreScrollY = true; + DrawMargin(e); +} + +void Margin::DrawMargin(Element e) { + e.prop=Property::Margin | Property::Rectangle; + e.width = status->MarginBarWidth; + elements.push_back(e); +} + +void Margin::DrawMargin(std::vector<Element> elts) { + for(Element &e:elts){ + DrawMargin(e); + } +} + +} // namespace cgeditor
\ No newline at end of file |
