GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(designer): 修复VC组件canResizing发生变化时无法拖拽 · Dicky-L/lowcode-engine@2d80d11

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • CONTRIBUTOR.md
  • packages/designer/src/builtin-simulator/bem-tools
    • border-resizing.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎CONTRIBUTOR.md‎

Copy file name to clipboardExpand all lines: CONTRIBUTOR.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
- [Ychangqing](https://github.com/Ychangqing)
2525
- [yize](https://github.com/yize)
2626
- [youluna](https://github.com/youluna)
27+
- [ibreathebsb](https://github.com/ibreathebsb)
2728

2829
如果您贡献过低代码引擎,但是没有看到您的名字,为我们的疏忽感到抱歉。欢迎您通过 PR 补充上自己的名字。
Collapse file

‎packages/designer/src/builtin-simulator/bem-tools/border-resizing.tsx‎

Copy file name to clipboardExpand all lines: packages/designer/src/builtin-simulator/bem-tools/border-resizing.tsx
+108-93Lines changed: 108 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -236,108 +236,123 @@ export class BoxResizingInstance extends Component<{
236236

237237
render() {
238238
const { observed } = this.props;
239-
if (!observed.hasOffset) {
240-
return null;
241-
}
242-
243-
const { node, offsetWidth, offsetHeight, offsetTop, offsetLeft } = observed;
244239
let triggerVisible: any = [];
245-
const { advanced } = node.componentMeta;
246-
if (advanced.getResizingHandlers) {
247-
triggerVisible = advanced.getResizingHandlers(node.internalToShellNode());
240+
let offsetWidth = 0;
241+
let offsetHeight = 0;
242+
let offsetTop = 0;
243+
let offsetLeft = 0;
244+
if (observed.hasOffset) {
245+
offsetWidth = observed.offsetWidth;
246+
offsetHeight = observed.offsetHeight;
247+
offsetTop = observed.offsetTop;
248+
offsetLeft = observed.offsetLeft;
249+
const { node } = observed;
250+
const metadata = node.componentMeta.getMetadata();
251+
if (metadata.configure?.advanced?.getResizingHandlers) {
252+
triggerVisible = metadata.configure.advanced.getResizingHandlers(node.internalToShellNode());
253+
}
248254
}
249-
250255
triggerVisible = normalizeTriggers(triggerVisible);
251256

252257
const baseSideClass = 'lc-borders lc-resize-side';
253258
const baseCornerClass = 'lc-borders lc-resize-corner';
254259

255260
return (
256261
<div>
257-
{triggerVisible.includes('N') && (
258-
<div
259-
ref={(ref) => { this.outlineN = ref; }}
260-
className={classNames(baseSideClass, 'n')}
261-
style={{
262-
height: 20,
263-
transform: `translate(${offsetLeft}px, ${offsetTop - 10}px)`,
264-
width: offsetWidth,
265-
}}
266-
/>
267-
)}
268-
{triggerVisible.includes('NE') && (
269-
<div
270-
ref={(ref) => { this.outlineNE = ref; }}
271-
className={classNames(baseCornerClass, 'ne')}
272-
style={{
273-
transform: `translate(${offsetLeft + offsetWidth - 5}px, ${offsetTop - 3}px)`,
274-
cursor: 'nesw-resize',
275-
}}
276-
/>
277-
)}
278-
{triggerVisible.includes('E') && (
279-
<div
280-
className={classNames(baseSideClass, 'e')}
281-
ref={(ref) => { this.outlineE = ref; }}
282-
style={{
283-
height: offsetHeight,
284-
transform: `translate(${offsetLeft + offsetWidth - 10}px, ${offsetTop}px)`,
285-
width: 20,
286-
}}
287-
/>
288-
)}
289-
{triggerVisible.includes('SE') && (
290-
<div
291-
ref={(ref) => { this.outlineSE = ref; }}
292-
className={classNames(baseCornerClass, 'se')}
293-
style={{
294-
transform: `translate(${offsetLeft + offsetWidth - 5}px, ${offsetTop + offsetHeight - 5}px)`,
295-
cursor: 'nwse-resize',
296-
}}
297-
/>
298-
)}
299-
{triggerVisible.includes('S') && (
300-
<div
301-
ref={(ref) => { this.outlineS = ref; }}
302-
className={classNames(baseSideClass, 's')}
303-
style={{
304-
height: 20,
305-
transform: `translate(${offsetLeft}px, ${offsetTop + offsetHeight - 10}px)`,
306-
width: offsetWidth,
307-
}}
308-
/>
309-
)}
310-
{triggerVisible.includes('SW') && (
311-
<div
312-
ref={(ref) => { this.outlineSW = ref; }}
313-
className={classNames(baseCornerClass, 'sw')}
314-
style={{
315-
transform: `translate(${offsetLeft - 3}px, ${offsetTop + offsetHeight - 5}px)`,
316-
cursor: 'nesw-resize',
317-
}}
318-
/>
319-
)}
320-
{triggerVisible.includes('W') && (
321-
<div
322-
ref={(ref) => { this.outlineW = ref; }}
323-
className={classNames(baseSideClass, 'w')}
324-
style={{
325-
height: offsetHeight,
326-
transform: `translate(${offsetLeft - 10}px, ${offsetTop}px)`,
327-
width: 20,
328-
}}
329-
/>
330-
)}
331-
{triggerVisible.includes('NW') && (
332-
<div
333-
ref={(ref) => { this.outlineNW = ref; }}
334-
className={classNames(baseCornerClass, 'nw')}
335-
style={{
336-
transform: `translate(${offsetLeft - 3}px, ${offsetTop - 3}px)`,
337-
cursor: 'nwse-resize',
338-
}}
339-
/>
340-
)}
262+
<div
263+
ref={(ref) => {
264+
this.outlineN = ref;
265+
}}
266+
className={classNames(baseSideClass, 'n')}
267+
style={{
268+
height: 20,
269+
transform: `translate(${offsetLeft}px, ${offsetTop - 10}px)`,
270+
width: offsetWidth,
271+
display: triggerVisible.includes('N') ? 'flex' : 'none',
272+
}}
273+
/>
274+
<div
275+
ref={(ref) => {
276+
this.outlineNE = ref;
277+
}}
278+
className={classNames(baseCornerClass, 'ne')}
279+
style={{
280+
transform: `translate(${offsetLeft + offsetWidth - 5}px, ${offsetTop - 3}px)`,
281+
cursor: 'nesw-resize',
282+
display: triggerVisible.includes('NE') ? 'flex' : 'none',
283+
}}
284+
/>
285+
<div
286+
className={classNames(baseSideClass, 'e')}
287+
ref={(ref) => {
288+
this.outlineE = ref;
289+
}}
290+
style={{
291+
height: offsetHeight,
292+
transform: `translate(${offsetLeft + offsetWidth - 10}px, ${offsetTop}px)`,
293+
width: 20,
294+
display: triggerVisible.includes('E') ? 'flex' : 'none',
295+
}}
296+
/>
297+
<div
298+
ref={(ref) => {
299+
this.outlineSE = ref;
300+
}}
301+
className={classNames(baseCornerClass, 'se')}
302+
style={{
303+
transform: `translate(${offsetLeft + offsetWidth - 5}px, ${
304+
offsetTop + offsetHeight - 5
305+
}px)`,
306+
cursor: 'nwse-resize',
307+
display: triggerVisible.includes('SE') ? 'flex' : 'none',
308+
}}
309+
/>
310+
<div
311+
ref={(ref) => {
312+
this.outlineS = ref;
313+
}}
314+
className={classNames(baseSideClass, 's')}
315+
style={{
316+
height: 20,
317+
transform: `translate(${offsetLeft}px, ${offsetTop + offsetHeight - 10}px)`,
318+
width: offsetWidth,
319+
display: triggerVisible.includes('S') ? 'flex' : 'none',
320+
}}
321+
/>
322+
<div
323+
ref={(ref) => {
324+
this.outlineSW = ref;
325+
}}
326+
className={classNames(baseCornerClass, 'sw')}
327+
style={{
328+
transform: `translate(${offsetLeft - 3}px, ${offsetTop + offsetHeight - 5}px)`,
329+
cursor: 'nesw-resize',
330+
display: triggerVisible.includes('SW') ? 'flex' : 'none',
331+
}}
332+
/>
333+
<div
334+
ref={(ref) => {
335+
this.outlineW = ref;
336+
}}
337+
className={classNames(baseSideClass, 'w')}
338+
style={{
339+
height: offsetHeight,
340+
transform: `translate(${offsetLeft - 10}px, ${offsetTop}px)`,
341+
width: 20,
342+
display: triggerVisible.includes('W') ? 'flex' : 'none',
343+
}}
344+
/>
345+
<div
346+
ref={(ref) => {
347+
this.outlineNW = ref;
348+
}}
349+
className={classNames(baseCornerClass, 'nw')}
350+
style={{
351+
transform: `translate(${offsetLeft - 3}px, ${offsetTop - 3}px)`,
352+
cursor: 'nwse-resize',
353+
display: triggerVisible.includes('NW') ? 'flex' : 'none',
354+
}}
355+
/>
341356
</div>
342357
);
343358
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.