ارائه دهنده ثابت
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
ConstantProvider
مجموعهای از اعداد جادویی، اشکال و رشتهها است که توسط سایر اجزای رندر و همچنین سایر بخشهای Blockly مانند فیلدهای داخلی استفاده میشود.
همه مقادیر ثابت ثابت فرض می شوند! تغییر مقادیر در زمان اجرا باعث ایجاد باگ های رندر می شود.
اشکال اتصال
ارائه دهنده ثابت شامل تعاریفی برای اشکال استاندارد اتصالات مختلف است. Notch
es اشکال اتصالات بعدی و قبلی را مشخص می کند. و PuzzleTab
اشکال اتصالات ورودی و خروجی را تعریف می کند. (این نام ها بر اساس اشکال ارائه شده توسط رندر پیش فرض هستند.)
شکل های اتصال بر اساس چک
ارائه دهنده ثابت همچنین می تواند شکل اتصالات را به صورت پویا بر اساس بررسی اتصال آنها تعریف کند. این کار با استفاده از روش shapeFor
انجام می شود.
مسیرهای مختلف دیگر
ارائهدهنده ثابت همچنین مسیرهایی را برای سایر بخشهای مختلف بلوک، مانند لبههای ناهموار برای بلوکهای فرو ریخته، تعریف میکند.
سایر مقادیر مختلف
و در نهایت، ارائه دهنده ثابت نیز مقادیر مختلفی را برای مواردی مانند padding بین عناصر مختلف یا حداقل ارتفاع ردیف ها تعریف می کند.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe \u003ccode\u003eConstantProvider\u003c/code\u003e stores essential values like shapes, strings, and numbers used by Blockly's rendering components.\u003c/p\u003e\n"],["\u003cp\u003eIt defines standard shapes for different connection types, including notches for previous/next connections and puzzle tabs for input/output connections.\u003c/p\u003e\n"],["\u003cp\u003eConnection shapes can be dynamically determined based on connection checks using the \u003ccode\u003eshapeFor\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConstantProvider\u003c/code\u003e also defines paths for elements like collapsed block edges and various values for padding and minimum heights.\u003c/p\u003e\n"],["\u003cp\u003eModifying \u003ccode\u003eConstantProvider\u003c/code\u003e values during runtime is discouraged as it can lead to rendering issues.\u003c/p\u003e\n"]]],["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"],null,["# Constant provider\n\nThe [`ConstantProvider`](/blockly/reference/js/blockly.blockrendering_namespace.constantprovider_class) is a collection of magic numbers,\nshapes and strings used by all of the other renderer components, as well as\nother parts of Blockly like the built-in fields.\n\nAll constant values are assumed to be *constant*! Changing values at\nruntime causes rendering bugs.\n\nConnection shapes\n-----------------\n\nThe constant provider contains definitions for the standard shapes of different\nconnections. [`Notch`](/blockly/reference/js/blockly.blockrendering_namespace.constantprovider_class.notch_property)es define the shapes of next and previous\nconnections. And the [`PuzzleTab`](/blockly/reference/js/blockly.blockrendering_namespace.constantprovider_class.puzzle_tab_property)s define the shapes of input\nand output connections. (These names are based on the shapes provided by\nthe default renderer.)\n\n### Connection shapes based on checks\n\nThe constant provider can also define the shapes of connections dynamically\nbased on their [connection check](/blockly/guides/create-custom-blocks/type-checks). This is done using the\n[`shapeFor`](/blockly/reference/js/blockly.blockrendering_namespace.constantprovider_class.shapefor_1_method) method.\n\nOther various paths\n-------------------\n\nThe constant provider also defines paths for other various parts of the\nblock, like jagged edges for collapsed blocks.\n\nOther various values\n--------------------\n\nAnd finally, the constant provider also defines various values for things like\nthe padding between different elements, or the minimum heights of rows."]]