mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 13:32:28 -05:00
24 lines
751 B
JavaScript
24 lines
751 B
JavaScript
|
/**
|
||
|
* Pretend paper.Item whose parent is a layer.
|
||
|
* @param {object} options Item params
|
||
|
* @param {string} options.strokeColor Value to return for the item's stroke color
|
||
|
* @param {string} options.fillColor Value to return for the item's fill color
|
||
|
* @param {string} options.strokeWidth Value to return for the item's stroke width
|
||
|
* @return {object} mock item
|
||
|
*/
|
||
|
const mockPaperRootItem = function (options) {
|
||
|
return {
|
||
|
strokeColor: {toCSS: function () {
|
||
|
return options.strokeColor;
|
||
|
}},
|
||
|
fillColor: {toCSS: function () {
|
||
|
return options.fillColor;
|
||
|
}},
|
||
|
strokeWidth: options.strokeWidth,
|
||
|
parent: {className: 'Layer'},
|
||
|
data: {}
|
||
|
};
|
||
|
};
|
||
|
|
||
|
export {mockPaperRootItem};
|