研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >IMetricsManager >getAbsoluteMetrics
IMetricsManager.getAbsoluteMetrics() 方法
获取绝对左侧和绝对顶部(以像素坐标表示)。这是可见工作区相对于 SVG 容器的位置。
Signature:
getAbsoluteMetrics(): AbsoluteMetrics;
返回:
AbsoluteMetrics
工作区的绝对指标。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-14。
[null,null,["最后更新时间 (UTC):2024-10-14。"],[[["The `getAbsoluteMetrics()` method provides the workspace's absolute position within its SVG container."],["It returns an `AbsoluteMetrics` object containing the absolute left and top coordinates in pixels."],["These coordinates represent where the visible workspace begins relative to the SVG container's origin."]]],["The `getAbsoluteMetrics()` method, part of the `IMetricsManager` interface, retrieves the absolute positioning of the visible workspace within the SVG container. It returns the absolute left and top coordinates, measured in pixels, representing where the workspace begins. The method's signature is `getAbsoluteMetrics(): AbsoluteMetrics`, and it outputs an `AbsoluteMetrics` object that contains the workspace's metrics.\n"]]