diff options
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 |
