Angus Leeming wrote:
On Thursday 31 October 2002 9:15 am, Rob Lahaye wrote:

Rod Pinna wrote:

In 1.2.2cvs, I have a graphic defined under the "latex size"
tab with

custom -> width (blank)
         Height 40 mm

In 1.3.0cvs, under the output section, this is opened as

width 100 scale%; height 40mm
"Changed behaviour" is too gentle; this is a bug in 1.3.0cvs!

Angus,

Attached patch fixes this and also includes the two former
patches I sent to this list. Could you please forget about
those and have a look at this one instead?

Thanks, Rob. All this looks reasonable. It's in.
Angus,

Along these lines (graphics and float stuff), please consider
the patch below. Some time ago, the rotation angle was promoted
from int to float, and it should be treated accordingly.
Since angle is rounded off to one place behind the comma:

   flimage_rotate(image, int(angle * 10), FLIMAGE_SUBPIXEL);

I assumed that float_equal should be used as with 0.1 tollerance.
E.g.

   lyx::float_equal(params.angle, 0.0, 0.1);

If that's indeed correct, the patch below is also ok.

Regards,
Rob.

Index: src/frontends/xforms/xformsImage.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/xformsImage.C,v
retrieving revision 1.12
diff -u -r1.12 xformsImage.C
--- src/frontends/xforms/xformsImage.C	2002/10/31 11:14:13	1.12
+++ src/frontends/xforms/xformsImage.C	2002/10/31 12:28:39
@@ -301,7 +301,7 @@
 	if (!image_)
 		return ;

-	if (!params.angle)
+	if (lyx::float_equal(params.angle, 0.0, 0.1))
 		// No rotation is necessary.
 		return;

@@ -311,7 +311,7 @@
 	// Work around xforms bug when params.angle == 270
 	// the 'InternalError: bad special angle' error.
 	// This bug fix is not needed in xforms 1.0 and greater.
-	if (params.angle == 270) {
+	if (lyx::float_equal(params.angle, 270.0, 0.1)) {
 		flimage_rotate(image_,  900, FLIMAGE_SUBPIXEL);
 		flimage_rotate(image_, 1800, FLIMAGE_SUBPIXEL);
 	} else {
Index: src/graphics/GraphicsImageXPM.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/graphics/GraphicsImageXPM.C,v
retrieving revision 1.32
diff -u -r1.32 GraphicsImageXPM.C
--- src/graphics/GraphicsImageXPM.C	2002/09/05 15:14:20	1.32
+++ src/graphics/GraphicsImageXPM.C	2002/10/31 12:28:40
@@ -296,7 +296,7 @@
 	if (image_.empty())
 		return ;

-	if (!params.angle)
+	if (lyx::float_equal(params.angle, 0.0, 0.1))
 		// No rotation is necessary.
 		return;

Index: src/graphics/GraphicsParams.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/graphics/GraphicsParams.C,v
retrieving revision 1.26
diff -u -r1.26 GraphicsParams.C
--- src/graphics/GraphicsParams.C	2002/09/05 15:14:20	1.26
+++ src/graphics/GraphicsParams.C	2002/10/31 12:28:40
@@ -27,7 +27,7 @@
 Params::Params()
 	: display(ColorDisplay),
 	  scale(100),
-	  angle(0)
+	  angle(0.0)
 {}

Reply via email to