Angus Leeming wrote:
On Sunday 27 October 2002 7:41 am, Rob Lahaye wrote:Angus Leeming wrote:On Thursday 24 October 2002 12:56 pm, Rob Lahaye wrote:Now I think of it, we may better use "scale = -1" (or any negative value) to indicate the use of width/height. Checking "scale < 0" is safer than checking "scale == 0.0", isn't it?Nah. What we have is fine. If implemented correctly.Angus, I don't like the way "scale == 0.0" is implemented now: lyx::float_equal(igp.scale, 0.0, 0.05) I still prefer using positive value for scaling, otherwise width/height. Advantages with this are:But it's incorrect. As I see it, these are the correct implemetations: some_float >= 0.0 lyx::float_equal(some_float, 0.0, 0.05) || some_float > 0.0 some_float > 0.0 !lyx::float_equal(some_float, 0.0, 0.05) && some_float > 0.0
You are probably right that my approach was too simplistic and wrong. But the solution you suggest here is too bizar for me. It's too much bloat for a really simple test. Moreover, you may use "0.05" for the scale tolerance here, and (by mistake) "0.005" in another file. You'll get funny and difficult errors this way. I'd then rather go the way Andre suggested: use a boolean "use_scale" to indicate what's going on. Simple and easy to understand code. I await if such a change is appreciated beforw the 1.3.0 release. However, please consider to apply the attached patch to CVS, since it fixes a real bug concerning input filters, and adds on the fly a few more of these "lyx::float_equal(scale, ... )" beasts. Regards, Rob.
FormGraphics.diff.gz
Description: application/gzip