Skip to content

[Bug Report] 背景组件的辅助线位置错误 #370

@kevinhwu

Description

@kevinhwu

问题描述
背景组件(lbp-background)的辅助线位置错误。

追踪到下面的代码中,获取到的背景尺寸是错误的。

calcVHLine (isPointMove) {
      const uuid = this.editingElement.uuid
      const referElements = this.elements.filter(e => e.uuid !== uuid)
      let referElementsXCoords = []
      let referElementsYCoords = []
      referElements.forEach(e => {
        const width = e.commonStyle.width // 读到的背景宽度是100,实际是320,下面几行读到的都是错误的。
        const left = e.commonStyle.left
        const height = e.commonStyle.height
        const top = e.commonStyle.top

        referElementsXCoords = [
          ...referElementsXCoords,
          left,
          left + (width / 2),
          left + width
        ]
        referElementsYCoords = [
          ...referElementsYCoords,
          top,
          top + (height / 2),
          top + height
        ]
      })

环境描述/版本信息 (请完成如下信息)

  • OS: windows
  • Browser: chrome
  • 本地开发版本最近版本(2021/9/21)

如何复现
复现步骤

  1. 编辑一个页面,添加一个组件
  2. 在背景上拖动组件,显示辅助线

预期结果

背景辅助线位置应该正确

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions