linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.24k stars 93 forks source link

Improve test image scale support. #519

Closed xStrom closed 2 years ago

xStrom commented 2 years ago

The current test image code has a constant size which is hardcoded to expect a scale factor of 2.0.

This PR changes the test image code to specify the logical size that the code actually uses, and then the platform code that actually generates the image and chooses the scale factor will also choose the proper image size.

Results remain unchanged for the scale factor of 2.0 but this reduces confusion and helps enable a future potential of doing snapshot testing with multiple different scale factors.

xStrom commented 2 years ago

Some test images have even more hardcoded 2.0 expectations. I'll need to address those as well.

xStrom commented 2 years ago

Okay, I think I managed to remove the last bits of hardcoded scale calculations.