From b31c8de1abaf87e3dd3e8c0b0cfb1bb866e5c0fe Mon Sep 17 00:00:00 2001 From: Fumiya Funatsu Date: Mon, 25 Aug 2025 17:46:57 +0900 Subject: [PATCH 1/2] fix: for windows oF 0.12.0 --- src/ofxSvgElements.h | 2 +- src/ofxSvgParser.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ofxSvgElements.h b/src/ofxSvgElements.h index 1fcc105..bc0f8f3 100755 --- a/src/ofxSvgElements.h +++ b/src/ofxSvgElements.h @@ -129,7 +129,7 @@ class Image : public Element { virtual void draw() override; glm::vec2 getAnchorPointForPercent( float ax, float ay ); - std::string getFilePath() { return filepath; } + std::string getFilePath() { return filepath.string(); } void setColor( ofColor aColor ) { color = aColor; diff --git a/src/ofxSvgParser.cpp b/src/ofxSvgParser.cpp index c151292..b9c614e 100755 --- a/src/ofxSvgParser.cpp +++ b/src/ofxSvgParser.cpp @@ -8,6 +8,7 @@ #include "ofUtils.h" #include #include "ofGraphics.h" +#include "boost/optional.hpp" using namespace ofx::svg; using std::string; @@ -27,7 +28,7 @@ bool Parser::load( of::filesystem::path aPathToSvg ) { ofFile mainXmlFile( aPathToSvg, ofFile::ReadOnly ); ofBuffer tMainXmlBuffer( mainXmlFile ); - svgPath = aPathToSvg; + svgPath = aPathToSvg.string(); folderPath = ofFilePath::getEnclosingDirectory( aPathToSvg, false ); ofXml xml; @@ -784,7 +785,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr aSvgPath ) { bool bRelative = false; std::vector npositions= {glm::vec3(0.f, 0.f, 0.f)}; - std::optional ctype; + boost::optional ctype; // check if we are looking for a position if( cchar == 'm' || cchar == 'M' ) { @@ -860,7 +861,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr aSvgPath ) { // } } - if( ctype.has_value() ) { + if( ctype != boost::none ) { // for( auto& np : npositions ) { // ofLogNotice(moduleName()) << cchar << " position: " << np; From 3a8d7a3d7b2963a0ea7c45b8f80e1636c0650346 Mon Sep 17 00:00:00 2001 From: Fumiya Funatsu Date: Tue, 26 Aug 2025 07:18:23 +0900 Subject: [PATCH 2/2] fix: replace boost::optional into CssClass::Optional --- src/ofxSvgParser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ofxSvgParser.cpp b/src/ofxSvgParser.cpp index b9c614e..e2f5771 100755 --- a/src/ofxSvgParser.cpp +++ b/src/ofxSvgParser.cpp @@ -8,7 +8,6 @@ #include "ofUtils.h" #include #include "ofGraphics.h" -#include "boost/optional.hpp" using namespace ofx::svg; using std::string; @@ -785,7 +784,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr aSvgPath ) { bool bRelative = false; std::vector npositions= {glm::vec3(0.f, 0.f, 0.f)}; - boost::optional ctype; + CssClass::Optional ctype; // check if we are looking for a position if( cchar == 'm' || cchar == 'M' ) { @@ -861,7 +860,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr aSvgPath ) { // } } - if( ctype != boost::none ) { + if( ctype.has_value() ) { // for( auto& np : npositions ) { // ofLogNotice(moduleName()) << cchar << " position: " << np;