FLTK logo

Re: [fltk.general] bug in fl_measure?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: bug in fl_measure? matthiasm Apr 26, 2006  
 

On Apr 26, 2006, at 6:00 PM, magik wrote:

here is code, it is strange, if text is text without spaces it returns good w value, but if there are spaces "sadfsdfasdf adsfasdf" it gives w some
about "sadfsdfasdf" but not all... h value is alvays good...


  int w, h;
...
  fl_measure(text, w, h);

The manual to fl_measure says: "Measure how wide and tall the string will be when printed by the fl_draw(...align) function. If the incoming w is non-zero it will wrap to that width.".

So in you case, you must set w and h to zero before calling the function, or it will do text wrapping at the space character (depending on what random value is in w).

----
http://robowerk.com/



Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.