@@ -977,9 +977,24 @@ protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidate
977
977
(byte ) color .getAlpha ());
978
978
}
979
979
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
+
980
995
// The image is drawn using a parallel projection.
981
996
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 );
983
998
984
999
// Apply the depth buffer but don't change it (for screen-space shapes).
985
1000
if ((!dc .isDeepPickingEnabled ()))
@@ -1001,20 +1016,6 @@ protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidate
1001
1016
osh .pushModelviewIdentity (gl );
1002
1017
gl .glTranslated (opm .screenPoint .x + this .dx , opm .screenPoint .y + this .dy , 0 );
1003
1018
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
-
1018
1019
Double heading = getActiveAttributes ().getHeading ();
1019
1020
Double pitch = getActiveAttributes ().getPitch ();
1020
1021
0 commit comments