-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSVGRenderer.h
39 lines (32 loc) · 1.01 KB
/
SVGRenderer.h
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
31
32
33
34
35
36
37
38
39
#ifndef SVGRENDERER_H
#define SVGRENDERER_H
#include "LinearGradient.h"
#include "SVGElement.h"
#include "Transform.h"
class SVGRenderer {
private:
Transform transform;
vector<LinearGradient> linearGradients;
public:
SVGRenderer(vector<LinearGradient> v) : linearGradients(v) {}
void render(Graphics &graphic, vector<SVGElement *>);
void renderTransform(Graphics &graphic, string transform);
};
void SVGRenderer::render(Graphics &graphic, vector<SVGElement *> element) {
for (auto i : element) {
string transforms = i->getTransform();
if (transforms != "") {
this->transform.parseTransform(transforms);
this->transform.appleMultipleTransforms(graphic);
i->render(graphic, linearGradients);
this->transform.resetTransform(graphic);
continue;
}
i->render(graphic, linearGradients);
}
}
// void SVGRenderer::renderTransform(Graphics &graphic, string transform) {
// this->transform.parseTransform(transform);
// this->transform.applyTransform(graphic);
// }
#endif