Skip to content

Support responsive scaling #20

@Kobzol

Description

@Kobzol

It is useful to have the ability to re-scale the whole slide deck to a different resolution and/or ratio (e.g. 4:3, 16:9, etc.). While this can be done manually in the Python code, e.g. like this:

foo.box(width=scale_width(500), height=scale_height(500))

The way I do it is that I have some reference resolution (e.g. FullHD), against which I code the contents of my slides, and then some actual resolution, which is rendered by elsie. Before rendering, I recompute all of the values essentially just by dividing FullHD with the actual resolution, to get the final scaled value. In this way I can modify the target render resolution with a one-line change, without modifying the contents of the slides.

However, it is a bit annoying if we have to scale all the values of presentations with my own functions everywhere.

It would be nice if there was some was to hook into nelsie, so that we could automatically rescale all values, like X, Y, width, height etc., before rendering, or if nelsie had this built-in, so that you could specify a source (logical) resolution, and a target render resolution.

A related alternative is to allow specifying all values as relative, e.g. as percentages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions