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:
parent
82f191bd79
commit
64162ab40d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue