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

Need doc on "Integer pixel coordinates don't match to pixels"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx2.0
    • fx2.0
    • javafx
    • Windows Vista x64, presidio-graphics-scrum-b478

      During prism tests creation I noticed that, for example (0, 0) coordinates are interpreted not as pixel at (0, 0), but rather the top left edge of that pixel if it can be considered as rectangle. So if draw the following line:

              Path path = new Path();
              MoveTo moveTo = new MoveTo(5, 10);
              LineTo lineTo = new LineTo(15, 10);
              path.getElements().addAll(moveTo, lineTo);
              path.setStroke(Color.RED);

      I will actualy get two pixel height rectangle representing this line. If I adjust this line as following:

              path.setTranslateX(0.5f);
              path.setTranslateY(0.5f);

      I'll get what I'd expect from the very beginning - a line that is one pixel width, occupaying exactly 10th row of pixels, starting with exactly 5th pixel ending on 14th pixel.

      In my opinion coordinates should match to pixels the way they do when the adjustment above is in place.

        1. HelloPath.java
          1 kB
        2. Line1.png
          Line1.png
          5 kB
        3. Line2.png
          Line2.png
          5 kB

            flar Jim Graham
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: