Browse Source

Gmt module: Fix error in gmt_font::Convert().

gmtdatadir
Michael Uleysky 8 years ago
parent
commit
8d843a7607
  1. 9
      modules/gmt/modgmt_structs.h

9
modules/gmt/modgmt_structs.h

@ -828,11 +828,12 @@ struct gmt_font: public gmt_struct
{
WordList::const_iterator ci;
WordList wl=Split(str,",",true);
std::string fakeerr;
// Defaults
size=default_size;
family=default_family;
color.Convert(0,err); // Black
color.Convert(0,fakeerr); // Black
if(wl.size()>3) {err="String "+str+" is not font string"; return false;} // String is [size][,family][,color] or [family][,color]
ci=wl.begin();
@ -840,7 +841,11 @@ struct gmt_font: public gmt_struct
{
Value2Width s(*ci);
bool suc=true;
{std::string fake; size=s(&suc,fake);}
{
std::string fake;
double newsize=s(&suc,fake);
if(suc) size=newsize;
}
if(!suc) // Parse error. check if argument is font name
{
if(0==families.count(*ci)) return false; // No, argument is not allowed font name

Loading…
Cancel
Save