File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
examples/feature-examples/src/pages/graph Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const config: Partial<LogicFlow.Options> = {
2222 isSilentMode : false ,
2323 stopScrollGraph : true ,
2424 stopZoomGraph : true ,
25+ // textDraggable: true, // TODO: 节点旋转状态下,拖动文本移动是有问题的!!!
26+ edgeTextDraggable : true ,
2527 style : {
2628 rect : {
2729 rx : 5 ,
Original file line number Diff line number Diff line change @@ -517,14 +517,17 @@ export class BaseEdgeModel<P extends PropertiesType = PropertiesType>
517517 * 内部方法,处理初始化文本格式
518518 */
519519 @action formatText ( data : EdgeConfig ) {
520+ const {
521+ editConfigModel : { edgeTextDraggable, edgeTextEdit } ,
522+ } = this . graphModel
520523 const { x, y } = this . textPosition
521524 const { text } = data
522525 let textConfig : Required < TextConfig > = {
523526 value : '' ,
524527 x,
525528 y,
526- draggable : false ,
527- editable : true ,
529+ draggable : edgeTextDraggable ,
530+ editable : edgeTextEdit ,
528531 }
529532
530533 if ( text ) {
Original file line number Diff line number Diff line change @@ -246,13 +246,16 @@ export class BaseNodeModel<P extends PropertiesType = PropertiesType>
246246 * 始化文本属性
247247 */
248248 private formatText ( data : NodeConfig ) : void {
249+ const {
250+ editConfigModel : { nodeTextDraggable, nodeTextEdit } ,
251+ } = this . graphModel
249252 const { x, y, text } = data
250253 let textConfig : TextConfig = {
251254 value : '' ,
252255 x,
253256 y,
254- draggable : false ,
255- editable : true ,
257+ draggable : nodeTextDraggable ,
258+ editable : nodeTextEdit ,
256259 }
257260 if ( text ) {
258261 if ( typeof text === 'string' ) {
You can’t perform that action at this time.
0 commit comments