mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-08 18:19:42 +00:00
let inBP return negative values, too.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4624 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a72387b287
commit
a833cc234e
@ -1,3 +1,8 @@
|
||||
|
||||
2002-07-15 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* lyxlength.C: inBP should be able to return negative values
|
||||
|
||||
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* lyxfunc.C: use lyx_gui::update_fonts()
|
||||
|
@ -165,6 +165,10 @@ int LyXLength::inPixels(int default_width, int default_height) const
|
||||
|
||||
// we don't care about sign of value, we
|
||||
// display negative space with text too
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning if you don't care than either call this function differently or let it return negative values and call abs() explicitly when needed (Andre')
|
||||
#endif
|
||||
|
||||
double result = 0.0;
|
||||
int val_sign = val_ < 0.0 ? -1 : 1;
|
||||
|
||||
@ -244,7 +248,6 @@ int LyXLength::inBP() const
|
||||
// return any LyXLength value as a one with
|
||||
// the PostScript point, called bp (big points)
|
||||
double result = 0.0;
|
||||
int val_sign = val_ < 0.0 ? -1 : 1;
|
||||
switch (unit_) {
|
||||
case LyXLength::CM:
|
||||
// 1bp = 0.2835cm
|
||||
@ -263,7 +266,7 @@ int LyXLength::inBP() const
|
||||
result = val_;
|
||||
break;
|
||||
}
|
||||
return static_cast<int>(result * val_sign + 0.5);
|
||||
return static_cast<int>(result + 0.5);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user