mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05: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.
|
||||
*/
|
||||
getAverageColor: function(object) {
|
||||
if (!object)
|
||||
object = this.getBounds();
|
||||
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: How about rounding of bounds.size?
|
||||
path = object;
|
||||
|
|
Loading…
Reference in a new issue