Commit ccdb3b70 by huangdarwin Committed by christosts

Effect: Add leading zero to decimals in floats.

PiperOrigin-RevId: 509518734
parent b18dccde
......@@ -116,7 +116,7 @@ public final class CropPixelTest {
public void drawFrame_cropSmaller_matchesGoldenFile() throws Exception {
String testId = "drawFrame_cropSmaller";
cropShaderProgram =
new Crop(/* left= */ -.9f, /* right= */ .1f, /* bottom= */ -1f, /* top= */ .5f)
new Crop(/* left= */ -0.9f, /* right= */ 0.1f, /* bottom= */ -1f, /* top= */ 0.5f)
.toGlShaderProgram(context, /* useHdr= */ false);
Size outputSize = cropShaderProgram.configure(inputWidth, inputHeight);
setupOutputTexture(outputSize.getWidth(), outputSize.getHeight());
......
......@@ -48,9 +48,9 @@ public final class CropTest {
public void configure_setCrop_changesDimensions() {
int inputWidth = 300;
int inputHeight = 200;
float left = -.5f;
float right = .5f;
float bottom = .5f;
float left = -0.5f;
float right = 0.5f;
float bottom = 0.5f;
float top = 1f;
Crop crop = new Crop(left, right, bottom, top);
......
......@@ -52,14 +52,14 @@ public final class ScaleToFitTransformationTest {
int inputHeight = 150;
ScaleToFitTransformation scaleToFitTransformation =
new ScaleToFitTransformation.Builder()
.setScale(/* scaleX= */ .5f, /* scaleY= */ 1f)
.setScale(/* scaleX= */ 0.5f, /* scaleY= */ 1f)
.build();
Size outputSize = scaleToFitTransformation.configure(inputWidth, inputHeight);
boolean isNoOp = scaleToFitTransformation.isNoOp(inputWidth, inputHeight);
assertThat(isNoOp).isFalse();
assertThat(outputSize.getWidth()).isEqualTo(Math.round(inputWidth * .5f));
assertThat(outputSize.getWidth()).isEqualTo(Math.round(inputWidth * 0.5f));
assertThat(outputSize.getHeight()).isEqualTo(inputHeight);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment