mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -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};
|