Skip to content

Is there an error in Extent.translate ? #3444

Closed

Description

@xvThomas

In the source code we found:

/** Return this extent moved x and y amounts */
  def translate(deltaX: Double, deltaY: Double): Extent =
    Extent(
      xmin + deltaX,
      ymin + deltaY,
      xmax + deltaX,
      ymin + deltaY
    )

Isn't it more like:

/** Return this extent moved x and y amounts */
  def translate(deltaX: Double, deltaY: Double): Extent =
    Extent(
      xmin + deltaX,
      ymin + deltaY,
      xmax + deltaX,
      ymax + deltaY
    )

ymax instead of ymin

Activity

  1. pomadchin commented on Feb 4, 2022

    @pomadchin
    Member

    Hey @xvThomas, you're absolutely right! Thx for catching it 🎉 ! Would you like to create a PR + a tiny unit test to trace this bug?

    🤦 I guess it was not widely used and that's why we never faced it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions