MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / getMaxMinProperty

Function getMaxMinProperty

public/iframe/lib/js/mixinsGroup.js:116–138  ·  view source on GitHub ↗
(template)

Source from the content-addressed store, hash-verified

114 top && (template.property.top = top)
115 },
116 getMaxMinProperty (template) {
117 // template 当前选中的组
118 // 计算成组后组内所有组件 包含子组占的最大宽高 用于给组设置宽高
119 const result = {
120 width: 0,
121 height: 0,
122 left: Infinity,
123 top: Infinity
124 }
125 const find = (node) => {
126 const upProperty = this.getParentGroupProperty(node)
127 if (node.property.type === 'group') {
128 node.property.children.map(child => {
129 find(child)
130 })
131 } else {
132 this.commonGetProperty(node.property, result, upProperty)
133 }
134 }
135 find(template)
136 return result;
137
138 },
139 setGroupProperty ($element) {
140 // 拖动组实时更新let top
141 const nowGroup = this.findGroupForId(this.nowGroupId)

Callers

nothing calls this directly

Calls 1

findFunction · 0.70

Tested by

no test coverage detected