Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem rescaling

Nicholas George
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, I want my panel to always have a horizontal range of 10000, and a vertical range of 4. I try to do this with the following:

I then draw as such:
g.fillOval( (int) (9000 * scaleX) , 100 , (int) (1000*scaleX) , 100 );

(well, I actually use affine transforms, but the problem's the same for both)

This works great as long as the window is wider than 500 pixels. If I resize it to be smaller than that, I start losing content on the right side. The above oval, for instance, which occupies the last thousand scaled pixels, drops out completely around a scale factor of .042, or a window size of 420.

It stinks like a rounding error to me, but I sure can't find it. I can post more code, but I'm not sure what else would be relevant.

any ideas?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic