Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4305155

DrawLine for vector-based HDCs incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • client-libs
    • None
    • beta
    • x86
    • windows_nt

      Date: Fri, 19 Nov 1999 18:12:55 -0800 (PST)
      From: Jim Graham <###@###.###>
      Subject: awt_Graphics.cpp
      To: ###@###.###
      MIME-Version: 1.0
      Content-MD5: DxBApaXX2U8lSm2WeGoQ4w==


      The following (new for Kestrel) code in DrawLine looks fishy:

          } else {
              SetPenColor(TRUE);
            VERIFY(::MoveToEx(hDC, nX1, nY1, NULL));
            VERIFY(::LineTo(hDC, nX2 + 1, nY2 + 1));
          }
       
      Shouldn't that be LineTo(nX2,nY2) followed by LineTo(nX2+1,nY2[+1])?
      I think someone looked at those two calls in a row and decided that
      they could be combined into one call to LineTo, but they can't because
      combining them changes the slope. The second call is simply to specify
      a very short line that moves off of the final pixel to work around
      GDI's silly "we don't draw the last pixel" crap.

      I think the code used to say "X2+1,Y2+1" for the second call to LineTo
      even though "X2+1,Y2" is enough (you just need a line that moves you to
      a different coordinate - any adjacent coordinate...)

                                    ...jim

            ehawkessunw Eric Hawkes (Inactive)
            dmendenhsunw David Mendenhall (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: