Skip to content

updateBounds() logic error #432

@thehabes

Description

@thehabes
async updateBounds({x, y, w, h}, options = {}) {
    if (!x || !y || !w || !h) {
        throw new Error('Bounds ({x,y,w,h}) must be provided')
    }
    if (options.creator) this.creator = options.creator
    this.target ??= ''
    const newTarget = this.updateTargetXYWH(this.target, x, y, w, h)
    if (this.target === newTarget) {
        return this
    }
    this.target = newTarget
    return this.update()
}

Yeah but I made the top left corner (0, 0) and you don't support 0. x=0 and y=0 should be valid bounds.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions