leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

文本有旋转角度后,双击编辑文本会偏移位置

Open mozbia opened this issue 8 months ago • 5 comments

重现代码:

import { Box, App, version, PointerEvent, ZoomEvent, LeafHelper, Rect, Text, Platform, } from 'leafer-ui'

import '@leafer-in/editor' import '@leafer-in/viewport' import '@leafer-in/flow' import '@leafer-in/resize' import '@leafer-in/state' import '@leafer-in/text-editor' import { Flow } from '@leafer-in/flow'

console.log(version) // 1.5.3 // alert(version) window.onload = () => { const div = document.createElement('div') div.setAttribute('id', 'window') div.setAttribute('style', 'width:600px;height:600px;background-color;') document.getElementsByTagName('body')[0].appendChild(div)

const leafer = new App({ view: 'window', usePartRender: true,

zoom: {
  disabled: true,
},
move: {
  disabled: true,
},

pointer: {
  preventDefault: false,
  preventDefaultMenu: true,
},
touch: {
  preventDefault: true,
},

// fill: '#eee',

tree: { type: 'design' },

editor: {
  stroke: '',
  // stroke: { color: '#000', type: 'solid' },
  hideOnMove: true,
  hideOnSmall: true,

  hoverStyle: {
    strokeWidth: 1,
    stroke: {
      color: '#000',
      type: 'solid',
    },
  },
  rotatePoint: {
    strokeWidth: 1,
    stroke: { color: '#000', type: 'solid' },
    width: 22,
    height: 22,
    fill: [
      {
        color: '#fff',
        type: 'solid',
      },
      {
        type: 'image',
        mode: 'strench',
        padding: 2,
        url: Platform.toURL(
          `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
            <path d="M12,6V9L16,5L12,1V4A8,8 0 0,0 4,12C4,13.57 4.46,15.03 5.24,16.26L6.7,14.8C6.25,13.97 6,13 6,12A6,6 0 0,1 12,6M18.76,7.74L17.3,9.2C17.74,10.04 18,11 18,12A6,6 0 0,1 12,18V15L8,19L12,23V20A8,8 0 0,0 20,12C20,10.43 19.54,8.97 18.76,7.74Z" />
            </svg>`,
          'svg'
        ),
      },
    ],
  },
  middlePoint: {
    width: 20,
    height: 7,
    cornerRadius: 4,
    strokeWidth: 1,
    stroke: {
      color: '#000',
      type: 'solid',
    },
  },
  point: {
    height: 14,
    width: 14,
    strokeWidth: 1,
    stroke: {
      color: '#000',
      type: 'solid',
    },
  },
  rect: {
    strokeWidth: 1,
    stroke: {
      color: '#000',
      type: 'solid',
    },
  },

  lockRatio: 'corner',
},

})

leafer.tree.addMany( new Text({ text: 'Hello Leafer', fontSize: 30, fill: '#000', x: 10, y: 10, fontFamily: 'Arial', fontWeight: 'bold', textAlign: 'center', editable: true, }) ) }

mozbia avatar May 13 '25 04:05 mozbia

收到,谢谢反馈~

leaferjs avatar May 13 '25 04:05 leaferjs

已修复,等待新版本发布~

leaferjs avatar May 26 '25 02:05 leaferjs

好的,幸苦大佬! 下一个版估计啥时候发布呢

mozbia avatar May 26 '25 03:05 mozbia

今天会发版

leaferjs avatar May 26 '25 06:05 leaferjs

新版本已发布

leaferjs avatar May 26 '25 08:05 leaferjs