@@ -102,21 +102,29 @@ ofxVisualProgramming::~ofxVisualProgramming(){
102102}
103103
104104// --------------------------------------------------------------
105- void ofxVisualProgramming::setup (ofxImGui::Gui* _guiRef){
106-
107- // Load resources
108- font->setup (MAIN_FONT,1.0 ,2048 ,true ,8 ,3 .0f );
105+ void ofxVisualProgramming::setRetina (bool retina){
106+ isRetina = retina;
109107
110- // Check retina screens
111- if (ofGetScreenWidth () >= RETINA_MIN_WIDTH && ofGetScreenHeight () >= RETINA_MIN_HEIGHT){
112- isRetina = true ;
108+ if (isRetina){
113109 scaleFactor = 2 ;
114110 fontSize = 26 ;
111+ canvas.setScale (2 );
112+ }else {
113+ scaleFactor = 1 ;
114+ fontSize = 12 ;
115115 }
116116
117117 nodeCanvas.setRetina (isRetina);
118118 profiler.setIsRetina (isRetina);
119119
120+ }
121+
122+ // --------------------------------------------------------------
123+ void ofxVisualProgramming::setup (ofxImGui::Gui* _guiRef){
124+
125+ // Load resources
126+ font->setup (MAIN_FONT,1.0 ,2048 ,true ,8 ,3 .0f );
127+
120128 // Initialise GUI
121129 if ( _guiRef == nullptr ){
122130 ofxVPGui = new ofxImGui::Gui ();
@@ -173,18 +181,12 @@ void ofxVisualProgramming::update(){
173181 // canvas init
174182 if (!inited){
175183 inited = true ;
176- canvasViewport.set (0 ,20 ,ofGetWindowWidth (),ofGetWindowHeight ()-20 );
177-
178- // RETINA FIX
179- if (ofGetScreenWidth () >= RETINA_MIN_WIDTH && ofGetScreenHeight () >= RETINA_MIN_HEIGHT){
180- canvas.setScale (2 );
181- }
184+ // canvasViewport.set(0,20,ofGetWindowWidth(),ofGetWindowHeight()-20);
182185 }
183186
184187 // Clear map from deleted objects
185188 clearObjectsMap ();
186189
187-
188190 // update patch objects
189191 if (!bLoadingNewPatch && !patchObjects.empty ()){
190192
0 commit comments