Fix HTML pagination test for high DPI values
The standard margins, expressed in millimeters, could result in the usable page space being much smaller than 1000px used for the DC size when using higher DPIs, which means that the test checking that a 2400px image took only 3 pages could fail, as it could require 4 of them in this case. Fix this by getting rid of the margins, as this should ensure that the page height is exactly 1000px now, independently of the actual DPI.
This commit is contained in:
@@ -51,6 +51,14 @@ TEST_CASE("wxHtmlPrintout::Pagination", "[html][print]")
|
||||
{
|
||||
wxHtmlPrintout pr;
|
||||
|
||||
// Pagination works in terms of printer page size, which is obtained by
|
||||
// subtracting margins from the total size and margins are expressed in
|
||||
// millimeters, so their conversion to pixels depends on DPI. To ensure
|
||||
// that we get the same results for all values of DPI, get just get rid
|
||||
// of the margins entirely (it would also be possible to adjust them by
|
||||
// the DPI-dependent factor, but it doesn't seem to be worth doing it).
|
||||
pr.SetMargins(0, 0, 0, 0, 0);
|
||||
|
||||
wxBitmap bmp(1000, 1000);
|
||||
wxMemoryDC dc(bmp);
|
||||
pr.SetUp(dc);
|
||||
|
Reference in New Issue
Block a user