diff options
| author | Tim Redfern <tim@getdrop.com> | 2023-04-20 16:54:26 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2023-04-20 16:54:26 +0100 |
| commit | 38c20e41403c3d081e41fe31a79e3a4396c72aac (patch) | |
| tree | f8a9fecabfe8910ac4e7909cc9a60e1e4c8c3639 /nextus/src | |
| parent | 1c028295bcf87c3f1c039d28cfbe59db1661be4e (diff) | |
visible text wrong scale
Diffstat (limited to 'nextus/src')
| -rw-r--r-- | nextus/src/ofApp.cpp | 1 | ||||
| -rw-r--r-- | nextus/src/vectorText.h | 14 |
2 files changed, 11 insertions, 4 deletions
diff --git a/nextus/src/ofApp.cpp b/nextus/src/ofApp.cpp index fa6a76b..3a44557 100644 --- a/nextus/src/ofApp.cpp +++ b/nextus/src/ofApp.cpp @@ -54,6 +54,7 @@ void ofApp::load_settings(){ void ofApp::update(){ svginput.update(); + textinput.update(); } diff --git a/nextus/src/vectorText.h b/nextus/src/vectorText.h index 153e363..4fac233 100644 --- a/nextus/src/vectorText.h +++ b/nextus/src/vectorText.h @@ -313,7 +313,7 @@ public: } } } - ofLog()<<"update: word "<<theword<<" ,segment "<<segment; + //ofLog()<<"update: word "<<theword<<" amount: "<<words[theword].amount; } vector<colourPolyline>& getOutlines(float s=1.0f,int style=STYLE_SENTENCE,float x=0,float y=0,bool anim=false,bool reverse=false, float vert_spread=0.0f, bool use_beat=false, float beat_duration=0.0f){ outlines.clear(); @@ -321,6 +321,10 @@ public: //if (beat_duration>segment){ //I don't think this is what segment is // return outlines; //} + + int drawglyphs=0; + int drawlines=0; + switch (style){ case STYLE_SENTENCE:{ float p=((-width())/2); @@ -342,11 +346,13 @@ public: } case STYLE_OVERLAPPING:{ for (auto& w:words){ - float p=(w.val*(ofGetWidth()-w.width)); - float v=y+(vert_spread*w.val*(ofGetHeight())); + float p=(w.val*(2.0-w.width)); //was screen based now 2.0 + float v=y+(vert_spread*w.val*(2.0)); //was screen based now 2.0 for (auto& g:w.glyphs){ if (w.amount>0.0f&&g.colour.getBrightness()>0){ + drawglyphs++; for (auto& o:g.outline){ + drawlines++; auto q=o; float a=anim?reverse?1.0f-segment:segment:1.0; q.scale(s*a,-s*a); @@ -362,7 +368,7 @@ public: break; } } - ofLog()<<"outlines for "<<words.size()<<" words: "<<outlines.size()<<" lines"; + //ofLog()<<"outlines for "<<words.size()<<" words: "<<outlines.size()<<" lines, found "<<drawglyphs<<" visible glyphs with "<<drawlines<<" visible lines"; return outlines; } };
\ No newline at end of file |
