Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bug in drawline? 1

Status
Not open for further replies.

Themuppeteer

Programmer
Apr 4, 2001
449
0
0
BE
I know this sound crazy, but I can't think of anything else but a bug in drawline.
I'm writing a clock, and everytime my 'hands' (arrow if you will,don't know what the right translation is..) pass 0,15,30 or 45 the hand is just not drawn. The coordinates are ok and all. I tested it with System.out.println(..)
In fact, when one of my coordinates (other the starting point wich is 0,0) is zero, it doesnt draw.

So then I tried a simple g.drawline(0,-600,0,600); and it did not work.
But g.drawline(-1,-600,0,600) does work.

Just for your information, I draw on a canvas, and I also do a g.translate(175,150); so that my clock would be nicely in the middle...

Anyone know what this strange fenonemon is ?

Thnx in advance.


Greetz,
img


NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)

"Those who say they understand chess, understand nothing"

-- Robert HUBNER
 
I tested :
Code:
g.translate(175,150);
g.drawLine(0,-600,0,600);
g.drawLine(-600,0,600,0);
both with jdk1.3.1 an jdk1.4.2 without any problem. The lines are drawn. I tested it both on a Canvas and on a JPanel. (I put those in a JFrame).
 
thnx for your reply hologram,
I've put 2 lines of extra code in my program to avoid the thing ((if x==0)x++) and when I removed those lines to reproduce the error (and post the code here) it did not happen anymore! I don't understand it, all I hanged meanwhile is making my clock smaller. hmmm strange.. I probably made some stupid mistake or something. Still trying to find my way in this java-maze of classes.

anyway, Thnx hologram for your effort

Greetz,
img


NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)

"Those who say they understand chess, understand nothing"

-- Robert HUBNER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top