Hi
I now have my painter working on my laptop whereI compiled the program.
It also runs on my desk computer as long as I don't re-compile it there. If I re-compile the same source code there it locks up the computer on the first "p.drawText" command. I have single stepped the program on both computers. Everything is the same. There is no problem with the "p.drawLine" command. If I option out the single p.drawText(x, y, "text"); line 16, the program runs fine.
p.drawLine ( xs, ys, xe, ye );
/// start of labeling.
if ( tempList[4] == "true" )
{
xc = ( xs + xe ) / 2;
yc = ( ys + ye ) / 2;
if ( xs == xe ) angle = pi/2.0;
else if ( ys == ye ) angle = 0.0;
else angle = atan((double)(ye - ys) / (double)(xe - xs));
angle = ( angle * 180.0 ) / pi;
p.save();
p.translate ( xc, yc );
p.rotate ( angle );
p.scale ( 1, -1 );
k = "S" + h.setNum ( n + 1 );
p.drawText ( 0, 0, k );
p.restore();
}
p.drawLine ( xs, ys, xe, ye );
/// start of labeling.
if ( tempList[4] == "true" )
{
xc = ( xs + xe ) / 2;
yc = ( ys + ye ) / 2;
if ( xs == xe ) angle = pi/2.0;
else if ( ys == ye ) angle = 0.0;
else angle = atan((double)(ye - ys) / (double)(xe - xs));
angle = ( angle * 180.0 ) / pi;
p.save();
p.translate ( xc, yc );
p.rotate ( angle );
p.scale ( 1, -1 );
k = "S" + h.setNum ( n + 1 );
p.drawText ( 0, 0, k );
p.restore();
}
To copy to clipboard, switch view to plain text mode
I am using the same Kubuntu 7.10 on each computer.
I am sorry to be such a pest.
Thanks for help.
Bookmarks