• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Revisioncead2d4a24e633fcb36b4237ea21a34b59335a40 (tree)
Zeit2022-04-26 04:29:32
AutorFojtik
CommiterFojtik

Log Message

Bounding box around rectangle should consider line width.

Ändern Zusammenfassung

Diff

diff -r 6a54954cc73c -r cead2d4a24e6 trunk/sources.cc/images.cc
--- a/trunk/sources.cc/images.cc Sun Apr 24 22:28:20 2022 +0200
+++ b/trunk/sources.cc/images.cc Mon Apr 25 21:29:32 2022 +0200
@@ -1280,19 +1280,23 @@
12801280 LoadWPG2Rectangle(cq->wpd,WPG._2Rect);
12811281
12821282 float X, Y;
1283- X=WPG._2Rect.X_ll; Y=WPG._2Rect.Y_ll;
1284- TRx.ApplyTransform(X,Y);
1285- UpdateBBox(bbx, 0, X,Y, 0,0);
1286- X=WPG._2Rect.X_ur; Y=WPG._2Rect.Y_ur;
1287- TRx.ApplyTransform(X,Y);
1288- UpdateBBox(bbx, 0, X,Y, 0,0);
1289- X=WPG._2Rect.X_ll; Y=WPG._2Rect.Y_ur;
1290- TRx.ApplyTransform(X,Y);
1291- UpdateBBox(bbx, 0, X,Y, 0,0);
1292- X=WPG._2Rect.X_ur; Y=WPG._2Rect.Y_ll;
1293- TRx.ApplyTransform(X,Y);
1294- UpdateBBox(bbx, 0, X,Y, 0,0);
1295-
1283+ const float LineWidthD2 = PSu2WPGu(PSS.LineWidth) / 2.0f;
1284+ for(int i=0; i<4; i++)
1285+ {
1286+ switch(i)
1287+ {
1288+ case 0: X=WPG._2Rect.X_ur; Y=WPG._2Rect.Y_ur;
1289+ break;
1290+ case 1: X=WPG._2Rect.X_ll; Y=WPG._2Rect.Y_ur;
1291+ break;
1292+ case 2: X=WPG._2Rect.X_ur; Y=WPG._2Rect.Y_ll;
1293+ break;
1294+ case 3: X=WPG._2Rect.X_ur; Y=WPG._2Rect.Y_ll;
1295+ break;
1296+ }
1297+ TRx.ApplyTransform(X,Y);
1298+ UpdateBBox(bbx, 0, X-LineWidthD2,Y-LineWidthD2, 2*LineWidthD2,2*LineWidthD2);
1299+ }
12961300 VectorRectangleArc *pRectArc = new VectorRectangleArc(
12971301 WPG._2Rect.Y_ll,WPG._2Rect.Y_ur, WPG._2Rect.X_ur, WPG._2Rect.X_ll,
12981302 WPG._2Rect.H_radius, WPG._2Rect.V_radius);
diff -r 6a54954cc73c -r cead2d4a24e6 trunk/sources.cc/wp2latex.h
--- a/trunk/sources.cc/wp2latex.h Sun Apr 24 22:28:20 2022 +0200
+++ b/trunk/sources.cc/wp2latex.h Mon Apr 25 21:29:32 2022 +0200
@@ -17,8 +17,8 @@
1717
1818 #define LineLength 80 /* Split lines after more than LineLength charcters */
1919
20-#define VersionWP2L "3.106"
21-#define VersionDate "21 Apr 2022" /* day (space) month (space) full year */
20+#define VersionWP2L "3.pre107"
21+#define VersionDate "22 Apr 2022" /* day (space) month (space) full year */
2222
2323 #ifndef false
2424 #define false 0
Show on old repository browser