Effect: Add leading zero to decimals in floats.
PiperOrigin-RevId: 509518734
This commit is contained in:
parent
20eae0e041
commit
b7d68fb62e
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user