Re: [Fwd: Re: [Cvslog] r18692 - /lyx-devel/trunk/src/LaTeXFeatures.cpp]

2007-06-16 Thread Enrico Forestieri
On Sat, Jun 16, 2007 at 11:08:19AM -0400, Richard Heck wrote:

> > - There are two more places where a floating point division may be 
> > useful. 
> Yes. Surprising no bug reports about that one, as it'll give the same 
> problem. But anyway, 
> we should just have: 

Yes. Possibly, limiting the precision to two decimal digits, as in the
other case.

-- 
Enrico


[Fwd: Re: [Cvslog] r18692 - /lyx-devel/trunk/src/LaTeXFeatures.cpp]

2007-06-16 Thread Richard Heck

[EMAIL PROTECTED] schrieb:
Author: rgheck Date: Wed Jun  6 21:33:57 2007 New Revision: 18692 
URL: http://www.lyx.org/trac/changeset/18692 Log: Fix bug 3823: 
Division needs not to return an integer. Also added some comments 
about a different possible fix.   
Two things: - Why do we divide by 255 and not by 256? 

Enrico answered that one.
- There are two more places where a floating point division may be 
useful. 
Yes. Surprising no bug reports about that one, as it'll give the same problem. But anyway, 
we should just have: 


Index: LaTeXFeatures.cpp
===
--- LaTeXFeatures.cpp   (Revision 18800)
+++ LaTeXFeatures.cpp   (Arbeitskopie)
@@ -664,11 +664,11 @@
if (mustProvide("ct-xcolor-soul")) {
RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
macros << "\\providecolor{lyxadded}{rgb}{"
-  << cadd.r/255 << ',' << cadd.g/255 << ',' << cadd.b/255 << 
"}\n";
+  << cadd.r / 255.0 << ',' << cadd.g / 255.0 << ',' << cadd.b / 255.0 
<< "}\n";

RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
macros << "\\providecolor{lyxdeleted}{rgb}{"
-  << cdel.r/255 << ',' << cdel.g/255 << ',' << cdel.b/255 << 
"}\n";
+  << cdel.r / 255.0 << ',' << cdel.g / 255.0 << ',' << cdel.b / 255.0 
<< "}\n";

macros << "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n"
   << 
"\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n";




--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto