cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.27k stars 213 forks source link

Text gets cut off when the AccessibilityRenderExtension is used and the font scale is set to 2f #1601

Open palpapp04 opened 2 hours ago

palpapp04 commented 2 hours ago

Description I have a snapshot test where I am using the AccessibilityRenderExtension and I have a font scale test parameter to create multiple snapshots with different font sizes. When the font scale is set to 2f and the AccessibilityRenderExtension is used texts on buttons get cut off. However when I do not use the AccessibilityRenderExtension the text on the buttons does not get cut off.

Steps to Reproduce Here is a sample project I created where the issue is reproducible by running the recordPaparazzi task. It contains 2 test classes one with AccessibilityRenderExtension and one without. When you run recordPaparazzi it will generate the snapshots (although the ones I generated are also contained in the zip file if I am correct) and you can see that the snapshots look the same except when the font scale is set to 2f. PaparazziTest.zip

Expected behavior My expectation would be that the generated snapshots are the same with and without the AccessibilityRenderExtension and that the text on the buttons does not get cut off when you use the AccessibilityRenderExtension

Additional information:

Screenshots com example paparazzitest_ExampleUnitTest_Example test where text is cut off MAX_FONT_CONFIG com example paparazzitest_ExampleWithoutA11yExtensionUnitTest_Example test where text is not cut off MAX_FONT_CONFIG

palpapp04 commented 2 hours ago

Thanks in advance to anyone for helping to resolve this issue :)