Skip to content

Rect::round_out is either incorrect or documented wrong #114

@danieldg

Description

@danieldg

The documentation claims that this function:

Converts into an IntRect rounding outwards.

However, the following code prints Some(IntRect { x: 1, y: 1, width: 2, height: 2 }) which is rounding the right and bottom edges inwards:

let r = Rect::from_ltrb(1.8, 1.8, 3.1, 3.1).unwrap();
println!("{:?}", r.round_out());

src/scan/path_aa.rs uses the "correct" implementation and calls out that Rect::round_out returns the wrong result.

I would suggest that the current implementation is useless, and replace it with the one from path_aa.rs that actually rounds out.

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