diff options
Diffstat (limited to 'liveengine/src/layers.cpp')
| -rw-r--r-- | liveengine/src/layers.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/liveengine/src/layers.cpp b/liveengine/src/layers.cpp index f140073..3ae7810 100644 --- a/liveengine/src/layers.cpp +++ b/liveengine/src/layers.cpp @@ -19,7 +19,9 @@ layer::~layer() }
-svglayer::svglayer() {}
+svglayer::svglayer() { + xo=0;yo=0; +}
svglayer::svglayer(string _f)
{
load(_f);
@@ -32,14 +34,16 @@ void svglayer::load(string _f){ fills.push_back(svg.getPathAt(i).getFillColor()); strokes.push_back(svg.getPathAt(i).getStrokeColor());
printf(" path %i: fill %08x stroke %08x\n",i,svg.getPathAt(i).getFillColor().getHex(),svg.getPathAt(i).getStrokeColor().getHex());
- }
+ } + xo=(ofGetWidth()-svg.getWidth())/2; + yo=(ofGetHeight()-svg.getHeight())/2;
}
void svglayer::draw(float a) {
//svg.draw(); for (int i=0;i<svg.getNumPath();i++) { svg.getPathAt(i).setFillColor(fills[i]*a); - svg.getPathAt(i).draw(); + svg.getPathAt(i).draw(xo,yo); }
}
|
