mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
remove getBoundRectanglePixels from PixelUtils
This commit is contained in:
parent
37445202f3
commit
11db5ca45c
@ -16,24 +16,6 @@
|
||||
return pixels;
|
||||
},
|
||||
|
||||
getBoundRectanglePixels : function (x0, y0, x1, y1) {
|
||||
var rectangle = this.getOrderedRectangleCoordinates(x0, y0, x1, y1);
|
||||
var pixels = [];
|
||||
// Creating horizontal sides of the rectangle:
|
||||
for (var x = rectangle.x0; x <= rectangle.x1; x++) {
|
||||
pixels.push({'col': x, 'row': rectangle.y0});
|
||||
pixels.push({'col': x, 'row': rectangle.y1});
|
||||
}
|
||||
|
||||
// Creating vertical sides of the rectangle:
|
||||
for (var y = rectangle.y0; y <= rectangle.y1; y++) {
|
||||
pixels.push({'col': rectangle.x0, 'row': y});
|
||||
pixels.push({'col': rectangle.x1, 'row': y});
|
||||
}
|
||||
|
||||
return pixels;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return an object of ordered rectangle coordinate.
|
||||
* In returned object {x0, y0} => top left corner - {x1, y1} => bottom right corner
|
||||
|
Loading…
Reference in New Issue
Block a user