mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add Raster specific tests to compareItems helper function.
This commit is contained in:
parent
b579b9c96c
commit
c3092db208
1 changed files with 17 additions and 3 deletions
|
@ -168,9 +168,23 @@ function compareItems(item, item2) {
|
|||
return item.symbol == item2.symbol;
|
||||
}, true);
|
||||
}
|
||||
|
||||
// TODO: Raster specific
|
||||
|
||||
|
||||
// Raster specific
|
||||
if (item instanceof Raster) {
|
||||
if (item._canvas) {
|
||||
equals(function() {
|
||||
return item._canvas != item2._canvas;
|
||||
}, true);
|
||||
}
|
||||
if (item._image) {
|
||||
equals(function() {
|
||||
return item._image = item2._image;
|
||||
}, true);
|
||||
}
|
||||
equals(item._size.toString(), item2._size.toString(),
|
||||
'item._size.toString() == item2._size.toString()');
|
||||
}
|
||||
|
||||
// TextItem specific:
|
||||
if (item instanceof TextItem) {
|
||||
equals(item.content, item2.content, 'item.content == item2.content');
|
||||
|
|
Loading…
Reference in a new issue