本文整理汇总了TypeScript中tinymce/core/api/geom/Rect.create函数的典型用法代码示例。如果您正苦于以下问题:TypeScript create函数的具体用法?TypeScript create怎么用?TypeScript create使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
suite.test('relativePosition', function () {
const sourceRect = Rect.create(0, 0, 20, 30),
targetRect = Rect.create(10, 20, 40, 50),
tests = [
// Only test a few of them all would be 81
['tl-tl', 10, 20, 20, 30],
['tc-tc', 20, 20, 20, 30],
['tr-tr', 30, 20, 20, 30],
['cl-cl', 10, 30, 20, 30],
['cc-cc', 20, 30, 20, 30],
['cr-cr', 30, 30, 20, 30],
['bl-bl', 10, 40, 20, 30],
['bc-bc', 20, 40, 20, 30],
['br-br', 30, 40, 20, 30],
['tr-tl', 50, 20, 20, 30],
['br-bl', 50, 40, 20, 30]
];
Tools.each(tests, function (item) {
LegacyUnit.deepEqual(
Rect.relativePosition(sourceRect, targetRect, item[0]),
Rect.create(item[1], item[2], item[3], item[4]),
item[0]
);
});
});