mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-08-28 22:30:04 -04:00
Merge pull request #444 from adroitwhiz/rectangle-clamp-fix
Fix Rectangle.Clamp()
This commit is contained in:
commit
c0e5115bfc
1 changed files with 5 additions and 5 deletions
|
@ -98,11 +98,11 @@ class Rectangle {
|
|||
this.right = Math.min(this.right, right);
|
||||
this.bottom = Math.max(this.bottom, bottom);
|
||||
this.top = Math.min(this.top, top);
|
||||
// Ensure rectangle coordinates in order.
|
||||
this.left = Math.min(this.left, this.right);
|
||||
this.right = Math.max(this.right, this.left);
|
||||
this.bottom = Math.min(this.bottom, this.top);
|
||||
this.top = Math.max(this.top, this.bottom);
|
||||
|
||||
this.left = Math.min(this.left, right);
|
||||
this.right = Math.max(this.right, left);
|
||||
this.bottom = Math.min(this.bottom, top);
|
||||
this.top = Math.max(this.top, bottom);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue