mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Improve placement of belts
This commit is contained in:
@@ -175,13 +175,14 @@ export class Rectangle {
|
||||
return new Rectangle(this.x * factor, this.y * factor, this.w * factor, this.h * factor);
|
||||
}
|
||||
|
||||
// Increases the rectangle in all directions
|
||||
expandInAllDirections(amount) {
|
||||
this.x -= amount;
|
||||
this.y -= amount;
|
||||
this.w += 2 * amount;
|
||||
this.h += 2 * amount;
|
||||
return this;
|
||||
/**
|
||||
* Expands the rectangle in all directions
|
||||
* @param {number} amount
|
||||
* @returns {Rectangle} new rectangle
|
||||
*/
|
||||
|
||||
expandedInAllDirections(amount) {
|
||||
return new Rectangle(this.x - amount, this.y - amount, this.w + 2 * amount, this.h + 2 * amount);
|
||||
}
|
||||
|
||||
// Culling helpers
|
||||
|
||||
Reference in New Issue
Block a user