From 38c20e41403c3d081e41fe31a79e3a4396c72aac Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 20 Apr 2023 16:54:26 +0100 Subject: visible text wrong scale --- nextus/src/vectorText.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'nextus/src/vectorText.h') 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 "<& 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 "<