Skip to content

Feature request: Make coordinate types configurable as float #47

@Arkarit

Description

@Arkarit

Currently, all coordinates are implemented as ints, which is perfectly fine for static pages.

The problem begins, when you begin to animate things. A perfectly smooth animation in a typical render loop is impossible using int output, since you always have frame time fractions, which lead to a jitter of the movement due to the conversion to int.

But I assume, litehtml often will be used as a UI support library, and at least in game UI smooth animation is crucial.

There could be a preprocessor switch for this, which could be set if you use float capable output like cairo and if you need it for animation, so that a coord_t could be either int or float/double.

The jitter effect is subtle, and I am not sure if it is worth the effort.
But smooth animations are a sign of quality at least in game development, and I wanted to post this just as a basis for discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions