mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 14:02:50 -05:00
23 lines
751 B
JavaScript
23 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};
|