How to use the domdiv.main.calculate_layout function in domdiv

To help you get started, we’ve selected a few domdiv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sumpfork / dominiontabs / tests / layout_tests.py View on Github external
def test_sleeved():
    options = main.parse_opts(["--size", "sleeved"])
    main.calculate_layout(options)
    assert options.dividerWidth == 9.4 * cm
    assert options.labelHeight == 0.9 * cm
    assert options.dividerHeight == 6.15 * cm + options.labelHeight
github sumpfork / dominiontabs / tests / layout_tests.py View on Github external
def test_vertical():
    options = main.parse_opts(["--orientation", "vertical"])
    assert options.orientation == "vertical"
    main.calculate_layout(options)
    assert options.numDividersHorizontal == 3
    assert options.numDividersVertical == 2
    assert options.dividerWidth == 5.9 * cm
    assert options.labelHeight == 0.9 * cm
    assert options.dividerHeight == 9.1 * cm + options.labelHeight
github sumpfork / dominiontabs / tests / layout_tests.py View on Github external
def test_horizontal():
    # should be the default
    options = main.parse_opts([])
    assert options.orientation == "horizontal"
    main.calculate_layout(options)
    assert options.numDividersHorizontal == 2
    assert options.numDividersVertical == 3
    assert options.dividerWidth == 9.1 * cm
    assert options.labelHeight == 0.9 * cm
    assert options.dividerHeight == 5.9 * cm + options.labelHeight