Skip to content

RectanglePoints confuses me #69

Description

@tp2750

When using CartesianIndex to define a rectangle, the resulting rectangle is not bounded by the pixels mentioned in the CartesianIndex.

Example:

julia>  RectanglePoints(CartesianIndex(1,2), CartesianIndex(3,4))
RectanglePoints(Point(1, 2), Point(3, 4))

But Point(1, 2) is the pixel with CartesianIndex(2,1).

The definition says:

 RectanglePoints(p1::CartesianIndex{2}, p2::CartesianIndex{2}) = RectanglePoints(Point(p1[1], p1[2]), Point(p2[1], p2[2]))

To me it would make a lot more sense to define it as

 RectanglePoints(p1::CartesianIndex{2}, p2::CartesianIndex{2}) = RectanglePoints(Point(p1[2], p1[1]), Point(p2[2], p2[1]))

Of course this would be breaking.

Am I just thinking about this the wrong way?

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