@@ -999,9 +999,25 @@ protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidate
999
999
(byte ) color .getAlpha ());
1000
1000
}
1001
1001
1002
+ // Compute the scale
1003
+ double xscale ;
1004
+ Double scale = this .getActiveAttributes ().getScale ();
1005
+ if (scale != null )
1006
+ xscale = scale * this .activeTexture .getWidth (dc );
1007
+ else
1008
+ xscale = this .activeTexture .getWidth (dc );
1009
+
1010
+ double yscale ;
1011
+ if (scale != null )
1012
+ yscale = scale * this .activeTexture .getHeight (dc );
1013
+ else
1014
+ yscale = this .activeTexture .getHeight (dc );
1015
+
1016
+ double maxwh = Math .max (xscale , yscale );
1017
+
1002
1018
// The image is drawn using a parallel projection.
1003
1019
osh .pushProjectionIdentity (gl );
1004
- gl .glOrtho (0d , dc .getView ().getViewport ().width , 0d , dc .getView ().getViewport ().height , -1d , 1d );
1020
+ gl .glOrtho (0d , dc .getView ().getViewport ().width , 0d , dc .getView ().getViewport ().height , -0.6 * maxwh , 0.6 * maxwh );
1005
1021
1006
1022
// Apply the depth buffer but don't change it (for screen-space shapes).
1007
1023
if ((!dc .isDeepPickingEnabled ()))
@@ -1023,20 +1039,6 @@ protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidate
1023
1039
osh .pushModelviewIdentity (gl );
1024
1040
gl .glTranslated (opm .screenPoint .x + this .dx , opm .screenPoint .y + this .dy , 0 );
1025
1041
1026
- // Compute the scale
1027
- double xscale ;
1028
- Double scale = this .getActiveAttributes ().getScale ();
1029
- if (scale != null )
1030
- xscale = scale * this .activeTexture .getWidth (dc );
1031
- else
1032
- xscale = this .activeTexture .getWidth (dc );
1033
-
1034
- double yscale ;
1035
- if (scale != null )
1036
- yscale = scale * this .activeTexture .getHeight (dc );
1037
- else
1038
- yscale = this .activeTexture .getHeight (dc );
1039
-
1040
1042
Double heading = getActiveAttributes ().getHeading ();
1041
1043
Double pitch = getActiveAttributes ().getPitch ();
1042
1044
0 commit comments