Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ofxSvgElements.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions src/ofxSvgParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "ofUtils.h"
#include <regex>
#include "ofGraphics.h"
#include "boost/optional.hpp"

using namespace ofx::svg;
using std::string;
Expand All @@ -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;
Expand Down Expand Up @@ -784,7 +785,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr<Path> aSvgPath ) {

bool bRelative = false;
std::vector<glm::vec3> npositions= {glm::vec3(0.f, 0.f, 0.f)};
std::optional<ofPath::Command::Type> ctype;
boost::optional<ofPath::Command::Type> ctype;
Copy link
Owner

@NickHardeman NickHardeman Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try updating this to
CssClass::Optional<ofPath::Command::Type> ctype;
Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I think this PR is sill valuable for windows 0.12.0 oF users, so I'll create another PR for this (as for 0.12.1.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #3. I tested it with oF v0.12.1 both macOS / Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CssClass::Optional<ofPath::Command::Type> ctype;

Sorry for having miss-checked this. I also test this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on macOS/Windows oF 0.12.0 / 0.12.1.
Now both #2 and #3 is the same one. So I'll close #2.


// check if we are looking for a position
if( cchar == 'm' || cchar == 'M' ) {
Expand Down Expand Up @@ -860,7 +861,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr<Path> aSvgPath ) {
// }
}

if( ctype.has_value() ) {
if( ctype != boost::none ) {

// for( auto& np : npositions ) {
// ofLogNotice(moduleName()) << cchar << " position: " << np;
Expand Down