aboutsummaryrefslogtreecommitdiff
path: root/src/components/Margin.cpp
blob: 077cce563fffee233aa0ef79c8356dfa23979c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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