diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-10-29 11:01:41 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-10-29 11:01:41 +0000 |
| commit | bcc4abca24d04b29a929ed063f18a080041fe0be (patch) | |
| tree | 5e51a5a24d1f53901ebf1abdd67ff32299aa1b6a /gui/src/chainImageSet.cpp | |
| parent | 4d3ec3d2ef37102e5b233704deb4cd7af727e1a3 (diff) | |
loading fixed
Diffstat (limited to 'gui/src/chainImageSet.cpp')
| -rw-r--r-- | gui/src/chainImageSet.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp index dd43fec..f27cd73 100644 --- a/gui/src/chainImageSet.cpp +++ b/gui/src/chainImageSet.cpp @@ -207,8 +207,8 @@ void chainImageSet::drawGui(int x,int y,bool is_selected){ } -bool chainImageSet::add(std::string filename,glm::vec2 pos){ - printf("Dropped file: %s at %f,%f \n",filename.c_str(),pos.x,pos.y); +bool chainImageSet::add(std::string filename,ofPoint pos,float ratio,float rotation){ + //printf("Dropped file: %s at %f,%f \n",filename.c_str(),pos.x,pos.y); /* attempt to add file to chain. find if file exists in data folder @@ -218,9 +218,9 @@ save dragdrop pos in loadingImages and attempt to insert in the chain */ auto image=std::make_unique<chainImage>(); - image->init(ofPoint(0,0), - 0.3, //currentDefaultImageRatio, - 0 //default rotation + image->init(pos, + ratio, + rotation ); printf("Loading file: %s linkscale %f\n", @@ -449,11 +449,19 @@ bool chainImageSet::loadJson(std::string _filename){ images.clear(); for (int i=0;i<json["images"].size();i++){ + /* auto image=std::make_unique<chainImage>(); if (image->fromJson(json["images"][i])){ images.push_back(std::move(image)); } + */ + add(json["images"][i]["filename"].asString(), + ofPoint(json["images"][i]["linkPos"][0].asDouble(),json["images"][i]["linkPos"][1].asDouble()), + json["images"][i]["linkScale"].asDouble(), + json["images"][i]["linkRot"].asDouble() + ); } + /* for (auto ii=images.begin(); ii != images.end(); ii++){ auto li=ii; li++; @@ -468,6 +476,7 @@ bool chainImageSet::loadJson(std::string _filename){ (*currentImage)->start(); filename=_filename; return true; + */ } |
