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

Negative scale does not work.

XMLWordPrintable

    • 1.0beta2
    • sparc
    • solaris_2.4
    • Not verified

      From ###@###.### Sat Oct 7 11:53:25 1995
      From: Leslie Picardo <###@###.###>
      To: java-interest@java
      Subject: Q: awt.Graphics translate() and scale() methods


       Re: preBeta JDK using appletviewer

       Q: I'm creating an applet in which I'd like to use a normal
          cartesian coordinate system to do my graphics drawing instead
          of the default window coordinate system. The awt.Graphics.translate()
          method works fine and allows me to reposition the origin but the
          awt.Graphics.scale() function only seems to work for positive
          values. I want to flip the coordinate system so that the y-axis is
          positive upwards. How do I do that ?
       

          eg:
           . . .
           public paint(Graphics g){
             // put origin at center of applet
             g.translate( size().width/2, size().height/2 );
             // try to flip the coordinate system so that y-axis is +ve up
             g.scale((float) 1, (float) -1);
             // ...................^^^^^^^
             //This screws up subsequent graphics operations
           }
       
        If I use positive values for the scale(sx, sy) method it works fine
        but my coordinate system is upside down which I don't like.

        
      Leslie Picardo
      ###@###.###


      -
      Note to Sun employees: this is an EXTERNAL mailing list!
      Info: send 'help' to ###@###.###

            sshaiosunw Sami Shaio (Inactive)
            ahoffsunw Arthur Hoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: