常數供應商
ConstantProvider
是一組魔法數字、形狀和字串,所有其他轉譯器元件,以及 Blockly 的其他部分,例如內建欄位。
所有常數值均假設為常數!在執行階段變更值會導致轉譯錯誤。
連線形狀
常數提供者包含不同連線標準形狀的定義,Notch
則定義下一個和上一個連線的形狀。PuzzleTab
則定義輸入和輸出連線的形狀。(這些名稱以預設轉譯器提供的形狀為基礎)。
根據檢查項目產生的連線形狀
常數提供者也可以根據其連線檢查,動態定義連線的形狀。方法是使用 shapeFor
方法。
其他各種路徑
常數提供者也會定義區塊其他不同部分的路徑,例如用於收合區塊的鋸齒狀邊緣。
其他各種值
最後,常數提供者也會定義各種值,例如不同元素之間的邊框間距或資料列的最小高度。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-12-02 (世界標準時間)。
[null,null,["上次更新時間: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"]]