paperjs - Paperjs 参考不包括所有选项
问题描述
您能否建议我在哪里可以找到有关 Group({insert:true}) 选项的解释,因为我在参考中找不到它?这个选项是如何工作的,如果有人做了那个例子,他应该能够在某个地方读到它。谢谢。
解决方案
此项目构造函数选项是一个内部 API,实际上没有公共用例,这就是您在文档中没有找到它的原因。
它主要用于内部操作和测试目的。
默认情况true
下,如果将其设置为false
,则创建的项目将不会插入到场景图中,这意味着您不会在屏幕上看到它。
查看此草图以进行演示。
// This item will be inserted as a child of the active layer.
const itemInserted = new Path.Circle({
center: view.center - 50,
radius: 50,
fillColor: 'orange'
});
// This item will not be inserted in the scene graph.
const itemNotInserted = new Path.Circle({
center: view.center + 50,
radius: 50,
fillColor: 'blue',
insert: false
});
推荐阅读
- encryption - 批量生成 AWS KMS 数据密钥
- pandas - Scipy 优化 Pandas 数据框
- tensorflow - 如何使用 tf.dataset 进行预测?
- python - Python 实例未创建
- sql - 如何在 Oracle Data Integrator 12c 中为 group by 字段创建字符串
- powershell - 尝试使用 powershell 打开 oracle 服务器的连接
- xml - 如何在 'XREF' 元素中包装 'styled-content' 值
- c - 确定 N 是否为素数(如果 N 为 [2 <= N <= 2^63-1])的最佳算法是什么?
- google-chrome - 谷歌分析目标没有跟踪所有订单
- javascript - 我需要帮助在 Discord.JS 中创建警告命令