mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-04 17:00:28 -04:00
Simplify some code in #getAverageColor().
This commit is contained in:
parent
96f7d140a7
commit
50e1509ab9
1 changed files with 3 additions and 3 deletions
|
@ -228,10 +228,10 @@ var Raster = this.Raster = PlacedItem.extend(/** @lends Raster# */{
|
||||||
* specified path, rectangle or point.
|
* specified path, rectangle or point.
|
||||||
*/
|
*/
|
||||||
getAverageColor: function(object) {
|
getAverageColor: function(object) {
|
||||||
if (!object)
|
|
||||||
object = this.getBounds();
|
|
||||||
var bounds, path;
|
var bounds, path;
|
||||||
if (object instanceof PathItem) {
|
if (!object) {
|
||||||
|
bounds = this.getBounds();
|
||||||
|
} else if (object instanceof PathItem) {
|
||||||
// TODO: What if the path is smaller than 1 px?
|
// TODO: What if the path is smaller than 1 px?
|
||||||
// TODO: How about rounding of bounds.size?
|
// TODO: How about rounding of bounds.size?
|
||||||
path = object;
|
path = object;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue