homebeaver / SwingSet

try to complete SwingSet3 org.swinglabs.swingx jars 1.6.6 for java 8 and openjdk 17 (Temurin)
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Spiegelung von svg icons #31

Closed homebeaver closed 1 year ago

homebeaver commented 1 year ago

wie in https://github.com/homebeaver/SwingSet/issues/30#issuecomment-1250104582 beschrieben

homebeaver commented 1 year ago

point/axis reflection (mirroring)

wir haben 3 arten:

siehe https://de.wikipedia.org/wiki/Spiegelung_(Geometrie)#Punktspiegelung

Dazu etwas Theorie:


      [ x']   [  m00  m01  m02  ] [ x ]   [ m00x + m01y + m02 ]
      [ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
      [ 1 ]   [   0    0    1   ] [ 1 ]   [         1         ]

public AffineTransform(float m00,
                       float m10,
                       float m01,
                       float m11,
                       float m02,
                       float m12)

//          g2d.scale(-1f, -1f); // Punktspiegelung inversion, point reflection: horizontales und vertikales Spiegeln
            //axis of reflection
//          g2d.scale(-1f, 1f); // vertikal
//          g2d.scale(1, -1);   // horizontal

zu g2d.scale:
Concatenates the current Graphics2D Transform with a scaling transformation
Subsequent rendering is resized according to the specified scaling factors relative to the previous scaling.
This is equivalent to calling transform(S), where S is an AffineTransform represented by the following matrix: 
          [   sx   0    0   ]
          [   0    sy   0   ]
          [   0    0    1   ]
homebeaver commented 1 year ago

fürs Demo eignen sich keine symetrischen icons. Ich nehme die Feder:

grafik

homebeaver commented 1 year ago

die vertikate Spiegelung von align_left ergibt align_right:

grafik