AWTPlotRenderer: use float arithmetic instead of double followed by a conversion

Multiplying by 0.9 and converting back to float is slightly more
complicated and achieves the same effect as multiplying by the float
0.9f directly.

Change-Id: I555863bb1251badee8887b9b93c5463eda0a3509
Signed-off-by: Jonathan Nieder <jrn@google.com>
This commit is contained in:
Jonathan Nieder 2014-12-10 15:22:08 -08:00
parent 82f191bd79
commit 64162ab40d
1 changed files with 3 additions and 3 deletions

View File

@ -170,9 +170,9 @@ protected int drawLabel(int x, int y, Ref ref) {
}
if (ref.getPeeledObjectId() != null) {
float[] colorComponents = g.getBackground().getRGBColorComponents(null);
colorComponents[0] *= 0.9;
colorComponents[1] *= 0.9;
colorComponents[2] *= 0.9;
colorComponents[0] *= 0.9f;
colorComponents[1] *= 0.9f;
colorComponents[2] *= 0.9f;
g.setBackground(new Color(colorComponents[0],colorComponents[1],colorComponents[2]));
}
if (txt.length() > 12)