研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
常量提供程序
ConstantProvider
是所有其他渲染程序组件以及 Blockly 的其他部分(例如内置字段)使用的神奇数字、形状和字符串的集合。
所有常量值都假定为常量!在运行时更改值会导致渲染 bug。
连接形状
常量提供程序包含不同连接的标准形状的定义。Notch
用于定义下一个和上一个连接的形状。PuzzleTab
定义了输入和输出连接的形状。(这些名称基于默认渲染程序提供的形状。)
基于检查的连接形状
常量提供程序还可以根据其连接检查动态定义连接的形状。这是使用 shapeFor
方法完成的。
其他各种路径
常量提供程序还定义了代码块其他不同部分的路径,例如收起的块的锯齿状边缘。
其他各种值
最后,常量提供程序还为不同元素之间的内边距或行最小高度等内容定义各种值。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-02。
[null,null,["最后更新时间 (UTC):2023-12-02。"],[[["The `ConstantProvider` stores essential values like shapes, strings, and numbers used by Blockly's rendering components."],["It defines standard shapes for different connection types, including notches for previous/next connections and puzzle tabs for input/output connections."],["Connection shapes can be dynamically determined based on connection checks using the `shapeFor` method."],["The `ConstantProvider` also defines paths for elements like collapsed block edges and various values for padding and minimum heights."],["Modifying `ConstantProvider` values during runtime is discouraged as it can lead to rendering issues."]]],["The `ConstantProvider` stores essential rendering data for Blockly, including connection shapes, paths, and values. It defines standard connection shapes like `Notch` for next/previous connections and `PuzzleTab` for input/output. The `shapeFor` method allows dynamic shape definition based on connection checks. Additionally, it defines paths for block components, like jagged edges, and values for padding and minimum row heights, ensuring consistent rendering. Changing these values at runtime will cause rendering issues.\n"]]