summaryrefslogtreecommitdiff
path: root/liveengine/src/layers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'liveengine/src/layers.cpp')
-rw-r--r--liveengine/src/layers.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/liveengine/src/layers.cpp b/liveengine/src/layers.cpp
index d2698ef..d7c7d77 100644
--- a/liveengine/src/layers.cpp
+++ b/liveengine/src/layers.cpp
@@ -8,7 +8,8 @@ svglayer::svglayer(string _f)
load(_f);
}
-void svglayer::load(string _f){
+int svglayer::load(string _f){
+ //check if files exits
svg.load(_f);
printf("%i paths\n",svg.getNumPath());
for (int i=0;i<svg.getNumPath();i++) {
@@ -16,8 +17,11 @@ void svglayer::load(string _f){
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;
+ if (svg.getNumPath()>0) {
+ xo=(ofGetWidth()-svg.getWidth())/2;
+ yo=(ofGetHeight()-svg.getHeight())/2;
+ }
+ isLoaded= (svg.getNumPath()>0);
}
void svglayer::draw(float a) {