Search:

Type: Posts; User: brocode

Search: Search took 0.20 seconds.

  1. Replies
    12
    Views
    1,719

    Re: Drawing in JPanel not working as expected

    Most of what you said made sense to me, except I still don't quite understand the whole casting situation.

    So, I'm receiving for example height / 15 as an endpoint, let's say it equates to 5.5....
  2. Replies
    12
    Views
    1,719

    Re: Drawing in JPanel not working as expected

    Eureka! Thank you very much kind sir. Do you mind explaining to me however, why it works to cast a double as an int. Would that not still end up truncating the decimals, causing the slight offset?...
  3. Replies
    12
    Views
    1,719

    Re: Drawing in JPanel not working as expected

    Surprise surprise, it compiled with the double values and the offset is less noticeable but it's still there. Now I'm beginning to think that in the book the example happens to show the lines from...
  4. Replies
    12
    Views
    1,719

    Re: Drawing in JPanel not working as expected

    I had thought I'd edited that code, those + 1's should not be there. I have taken them out in my code, I guess I uploaded the wrong code in which I was testing if rounding up might fix the offset....
  5. Replies
    12
    Views
    1,719

    Re: Drawing in JPanel not working as expected

    I was thinking it was something along these lines as well, but could not figure out a way to work around it, because if I try to provide float values as arguments for the drawLine functions, I get...
  6. Replies
    12
    Views
    1,719

    Re: Drawing in JPanel not working as expected

    I mean, I could copy what's in pastebin to code snippets, but the code itself really doesn't get any more concise, each file is no longer than about 20 lines and all that's being done is a JFrame is...
  7. Replies
    12
    Views
    1,719

    Drawing in JPanel not working as expected

    First of all, I'd like to apologize if this is not in the correct section, this is my first post to the board. If I was wrong to post here, I welcome any criticism so long as you also teach me...
Results 1 to 7 of 7