SourceForge has been redesigned. Learn more.
Close

#7 misplaced lines

open
nobody
None
5
2004-10-27
2004-10-27
Vincent G.
No

Some lines were always drawn on the begining of the line.

gnujpdf-1.5
----PDFGraphics.java---------
private String cxy(double x,double y) {
double nx=x,ny=y; // scratch
double mw = (double)(media.width);
double mh = (double)(media.height);

// handle any translations
x-=trax;
y-=tray;

switch(mediaRot) {
case 0:
// Portrait
//nx = x;
ny = mh - y;
break;
--------------------------

Well, you declare nx with x, then you change x.
So you must change nx as well.

Remove the comment and everything is OK:

----PDFGraphics.java---------
private String cxy(double x,double y) {
double nx=x,ny=y; // scratch
double mw = (double)(media.width);
double mh = (double)(media.height);

// handle any translations
x-=trax;
y-=tray;

switch(mediaRot) {
case 0:
// Portrait
nx = x;
ny = mh - y;
break;
--------------------------

do the same for landscape, etc...

Discussion


Log in to post a comment.