projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typo: 'suposidly' -> 'supposedly'.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
distance.cpp
diff --git
a/synfig-core/trunk/src/synfig/distance.cpp
b/synfig-core/trunk/src/synfig/distance.cpp
index
0878d27
..
eb7da93
100644
(file)
--- a/
synfig-core/trunk/src/synfig/distance.cpp
+++ b/
synfig-core/trunk/src/synfig/distance.cpp
@@
-2,7
+2,7
@@
/*! \file distance.cpp
** \brief Template File
**
/*! \file distance.cpp
** \brief Template File
**
-** $Id
: distance.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp
$
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
@@
-60,7
+60,7
@@
Distance::Distance(const synfig::String& str)
float val;
int ret(strscanf(str,"%f%n",&val,&i));
synfig::info("Distance::Distance(): ret=%d, val=%f",ret,val);
float val;
int ret(strscanf(str,"%f%n",&val,&i));
synfig::info("Distance::Distance(): ret=%d, val=%f",ret,val);
-
+
if(ret<=0)
{
// Error
if(ret<=0)
{
// Error
@@
-69,7
+69,7
@@
Distance::Distance(const synfig::String& str)
}
else
value_=val;
}
else
value_=val;
-
+
synfig::info("Distance::Distance(): system=\"%s\"",String(str.begin()+i,str.end()).c_str());
system_=ident_system(String(str.begin()+i,str.end()));
*/
synfig::info("Distance::Distance(): system=\"%s\"",String(str.begin()+i,str.end()).c_str());
system_=ident_system(String(str.begin()+i,str.end()));
*/
@@
-81,8
+81,8
@@
Distance::operator=(const synfig::String& str)
int i(0);
float val;
int ret(strscanf(str,"%f%n",&val,&i));
int i(0);
float val;
int ret(strscanf(str,"%f%n",&val,&i));
- synfig::info("Distance::Distance(): ret=%d, val=%f",ret,val);
-
+
//
synfig::info("Distance::Distance(): ret=%d, val=%f",ret,val);
+
if(ret<=0)
{
// Error
if(ret<=0)
{
// Error
@@
-121,10
+121,10
@@
Distance::get(Distance::System target, const RendDesc& rend_desc)const
return units(rend_desc);
if(target==SYSTEM_PIXELS)
return units(rend_desc)*METERS_PER_UNIT*rend_desc.get_x_res();
return units(rend_desc);
if(target==SYSTEM_PIXELS)
return units(rend_desc)*METERS_PER_UNIT*rend_desc.get_x_res();
-
- return meters_to_system(meters(rend_desc),target);
+
+ return meters_to_system(meters(rend_desc),target);
}
}
-
+
Real
Distance::meters()const
{
Real
Distance::meters()const
{
@@
-194,7
+194,7
@@
Distance::ident_system(const synfig::String& x)
// If it is plural, make it singular
if(str[str.size()-1]=='S')
str=synfig::String(str.begin(),str.end()-1);
// If it is plural, make it singular
if(str[str.size()-1]=='S')
str=synfig::String(str.begin(),str.end()-1);
-
+
if(str.empty() || str=="U" || str=="UNIT")
return SYSTEM_UNITS;
if(str=="PX" || str=="PIXEL")
if(str.empty() || str=="U" || str=="UNIT")
return SYSTEM_UNITS;
if(str=="PX" || str=="PIXEL")
@@
-209,9
+209,9
@@
Distance::ident_system(const synfig::String& x)
return SYSTEM_CENTIMETERS;
if(str=="MM" || str=="MILLIMETER")
return SYSTEM_MILLIMETERS;
return SYSTEM_CENTIMETERS;
if(str=="MM" || str=="MILLIMETER")
return SYSTEM_MILLIMETERS;
-
+
synfig::warning("Distance::ident_system(): Unknown distance system \"%s\"",x.c_str());
synfig::warning("Distance::ident_system(): Unknown distance system \"%s\"",x.c_str());
-
+
return SYSTEM_UNITS;
}
return SYSTEM_UNITS;
}
@@
-227,7
+227,7
@@
Distance::system_name(Distance::System system)
case SYSTEM_METERS: return "m";
case SYSTEM_MILLIMETERS: return "mm";
case SYSTEM_CENTIMETERS: return "cm";
case SYSTEM_METERS: return "m";
case SYSTEM_MILLIMETERS: return "mm";
case SYSTEM_CENTIMETERS: return "cm";
-
+
default: throw BadSystem();
}
return synfig::String();
default: throw BadSystem();
}
return synfig::String();
@@
-245,7
+245,7
@@
Distance::system_local_name(Distance::System system)
case SYSTEM_METERS: return _("Meters");
case SYSTEM_MILLIMETERS:return _("Millimeters");
case SYSTEM_CENTIMETERS:return _("Centimeters");
case SYSTEM_METERS: return _("Meters");
case SYSTEM_MILLIMETERS:return _("Millimeters");
case SYSTEM_CENTIMETERS:return _("Centimeters");
-
+
default: throw BadSystem();
}
return synfig::String();
default: throw BadSystem();
}
return synfig::String();