mirror of
https://gitlab.com/manzerbredes/cgeditor.git
synced 2025-04-19 03:59:44 +00:00
30 lines
582 B
C++
30 lines
582 B
C++
![]() |
#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
|