@@ -977,9 +977,24 @@ protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidate
977977 (byte ) color .getAlpha ());
978978 }
979979
980+ // Compute the scale
981+ double xscale ;
982+ Double scale = this .getActiveAttributes ().getScale ();
983+ if (scale != null )
984+ xscale = scale * this .activeTexture .getWidth (dc );
985+ else
986+ xscale = this .activeTexture .getWidth (dc );
987+
988+ double yscale ;
989+ if (scale != null )
990+ yscale = scale * this .activeTexture .getHeight (dc );
991+ else
992+ yscale = this .activeTexture .getHeight (dc );
993+ double maxwh = Math .max (xscale , yscale );
994+
980995 // The image is drawn using a parallel projection.
981996 osh .pushProjectionIdentity (gl );
982- gl .glOrtho (0d , dc .getView ().getViewport ().width , 0d , dc .getView ().getViewport ().height , -1d , 1d );
997+ gl .glOrtho (0d , dc .getView ().getViewport ().width , 0d , dc .getView ().getViewport ().height , -0.6 * maxwh , 0.6 * maxwh );
983998
984999 // Apply the depth buffer but don't change it (for screen-space shapes).
9851000 if ((!dc .isDeepPickingEnabled ()))
@@ -1001,20 +1016,6 @@ protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidate
10011016 osh .pushModelviewIdentity (gl );
10021017 gl .glTranslated (opm .screenPoint .x + this .dx , opm .screenPoint .y + this .dy , 0 );
10031018
1004- // Compute the scale
1005- double xscale ;
1006- Double scale = this .getActiveAttributes ().getScale ();
1007- if (scale != null )
1008- xscale = scale * this .activeTexture .getWidth (dc );
1009- else
1010- xscale = this .activeTexture .getWidth (dc );
1011-
1012- double yscale ;
1013- if (scale != null )
1014- yscale = scale * this .activeTexture .getHeight (dc );
1015- else
1016- yscale = this .activeTexture .getHeight (dc );
1017-
10181019 Double heading = getActiveAttributes ().getHeading ();
10191020 Double pitch = getActiveAttributes ().getPitch ();
10201021
0 commit comments